]> git.mxchange.org Git - friendica.git/commitdiff
Check post existence before accessing its properties in Model\Post\UserNotification
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 1 Dec 2022 00:30:36 +0000 (19:30 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 1 Dec 2022 00:30:36 +0000 (19:30 -0500)
src/Model/Post/UserNotification.php

index 66ec6ac907916c5811756a3c4e18708aab173a00..b26fb292bc6b84d664a87689e2df1b2fc3ba4442 100644 (file)
@@ -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;
                        }
                }