[PLUGIN][ActivityPub][Model][Note] There may be no attachments, nor tags, nor to, nor cc

This commit is contained in:
2022-02-18 15:28:48 +00:00
parent ebbd8bf1e4
commit 9523927b8e
2 changed files with 4 additions and 4 deletions

View File

@@ -224,7 +224,7 @@ class Note extends Model
// Attachments
$processed_attachments = [];
foreach ($type_note->get('attachment') as $attachment) {
foreach ($type_note->get('attachment') ?? [] as $attachment) {
if ($attachment->get('type') === 'Document') {
// Retrieve media
$get_response = HTTPClient::get($attachment->get('url'));
@@ -253,7 +253,7 @@ class Note extends Model
// Assign conversation to this note
Conversation::assignLocalConversation($obj, $reply_to);
foreach ($type_note->get('tag') as $ap_tag) {
foreach ($type_note->get('tag') ?? [] as $ap_tag) {
switch ($ap_tag->get('type')) {
case 'Mention':
case 'Group':