From f69c591166e790a4906a0a1aef10abf553c1d7b2 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 29 Mar 2020 12:52:05 -0400 Subject: [PATCH] Add object key existence check in ActivityPub/Transmitter - Addresses https://github.com/friendica/friendica/issues/8000#issuecomment-605614192 --- src/Protocol/ActivityPub/Transmitter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index e39a4f9581..837e81c1e9 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -193,10 +193,10 @@ class Transmitter $items = Item::select(['id'], $condition, ['limit' => [($page - 1) * 20, 20], 'order' => ['created' => true]]); while ($item = Item::fetch($items)) { $activity = self::createActivityFromItem($item['id'], true); - $activity['type'] = $activity['type'] == 'Update' ? 'Create' : $activity['type']; + $activity['type'] = $activity['type'] == 'Update' ? 'Create' : $activity['type']; // Only list "Create" activity objects here, no reshares - if (is_array($activity['object']) && ($activity['type'] == 'Create')) { + if (!empty($activity['object']) && ($activity['type'] == 'Create')) { $list[] = $activity['object']; } } -- 2.39.5