浏览代码

Update NotificationService, fix account attribute

Daniel Supernault 3 年之前
父节点
当前提交
949b7bb6ea
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      app/Services/NotificationService.php

+ 6 - 2
app/Services/NotificationService.php

@@ -107,7 +107,9 @@ class NotificationService {
 		foreach($ids as $id) {
 			$n = self::rewriteMastodonTypes(self::getNotification($id));
 			if($n != null && in_array($n['type'], self::MASTODON_TYPES)) {
-				$n['account'] = AccountService::getMastodon($n['account']['id']);
+				if(isset($n['account'])) {
+					$n['account'] = AccountService::getMastodon($n['account']['id']);
+				}
 
 				if(isset($n['relationship'])) {
 					unset($n['relationship']);
@@ -135,7 +137,9 @@ class NotificationService {
 		foreach($ids as $id) {
 			$n = self::rewriteMastodonTypes(self::getNotification($id));
 			if($n != null && in_array($n['type'], self::MASTODON_TYPES)) {
-				$n['account'] = AccountService::getMastodon($n['account']['id']);
+				if(isset($n['account'])) {
+					$n['account'] = AccountService::getMastodon($n['account']['id']);
+				}
 
 				if(isset($n['relationship'])) {
 					unset($n['relationship']);