Skip to content

Commit

Permalink
Check array key existence in ActivityPub\Transmitter::createPermissio…
Browse files Browse the repository at this point in the history
…nBlockForItem

- APContact::getByURL can return empty array
- Address friendica#11218 (comment)
  • Loading branch information
MrPetovan committed Mar 19, 2022
1 parent 61e023d commit 9eb6299
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Protocol/ActivityPub/Transmitter.php
Expand Up @@ -529,7 +529,7 @@ private static function createPermissionBlockForItem($item, $blindcopy, $last_id
$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;
}
Expand Down

0 comments on commit 9eb6299

Please sign in to comment.