From: Hypolite Petovan Date: Sun, 29 Mar 2020 16:52:05 +0000 (-0400) Subject: Add object key existence check in ActivityPub/Transmitter X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f69c591166e790a4906a0a1aef10abf553c1d7b2;p=friendica.git Add object key existence check in ActivityPub/Transmitter - Addresses https://github.com/friendica/friendica/issues/8000#issuecomment-605614192 --- 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']; } }