From 9eb6299f1946132e2c0d13e7425377a6caf9adf5 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 19 Mar 2022 03:12:39 -0400 Subject: [PATCH] Check array key existence in ActivityPub\Transmitter::createPermissionBlockForItem - APContact::getByURL can return empty array - Address https://github.com/friendica/friendica/issues/11218#issuecomment-1066753232 --- src/Protocol/ActivityPub/Transmitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index d602d9f86b..2cab827bb1 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -529,7 +529,7 @@ class Transmitter $parent = Post::selectFirst(['causer-link', 'post-reason'], ['id' => $item['parent']]); if (($parent['post-reason'] == Item::PR_ANNOUNCEMENT) && !empty($parent['causer-link'])) { $profile = APContact::getByURL($parent['causer-link'], false); - $is_forum_thread = ($profile['type'] == 'Group'); + $is_forum_thread = isset($profile['type']) && $profile['type'] == 'Group'; } else { $is_forum_thread = false; } -- 2.39.5