Check array key existence in ActivityPub\Transmitter::createPermissionBlockForItem

- APContact::getByURL can return empty array
- Address https://github.com/friendica/friendica/issues/11218#issuecomment-1066753232
This commit is contained in:
Hypolite Petovan 2022-03-19 03:12:39 -04:00
parent 61e023d448
commit 9eb6299f19

View File

@ -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;
}