From 8012968506d75dda4d798a626b1daf549a59939d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 30 Nov 2022 19:30:36 -0500 Subject: [PATCH] Check post existence before accessing its properties in Model\Post\UserNotification --- src/Model/Post/UserNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Post/UserNotification.php b/src/Model/Post/UserNotification.php index 66ec6ac907..b26fb292bc 100644 --- a/src/Model/Post/UserNotification.php +++ b/src/Model/Post/UserNotification.php @@ -435,7 +435,7 @@ class UserNotification // Don't notify about reshares by communities of our own posts or each time someone comments if (($item['verb'] == Activity::ANNOUNCE) && DBA::exists('contact', ['id' => $item['contact-id'], 'contact-type' => Contact::TYPE_COMMUNITY])) { $post = Post::selectFirst(['origin', 'gravity'], ['uri-id' => $item['thr-parent-id'], 'uid' => $uid]); - if ($post['origin'] || ($post['gravity'] != Item::GRAVITY_PARENT)) { + if (!$post || $post['origin'] || ($post['gravity'] != Item::GRAVITY_PARENT)) { return false; } }