]> git.mxchange.org Git - friendica.git/commitdiff
Account for false return value of Repository\Notify->insert in notification()
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 29 Jun 2020 22:58:17 +0000 (18:58 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 29 Jun 2020 22:58:17 +0000 (18:58 -0400)
- Address https://github.com/friendica/friendica/issues/8473#issuecomment-651393541

include/enotify.php

index 89a81833d08308bfea5ed3303f6a9f2fac242118..6b3171dda6d6cd2102ae9035cbd746201602a79a 100644 (file)
@@ -479,6 +479,11 @@ function notification($params)
                        'otype'         => $params['otype'] ?? '',
                ]);
 
+               // Notification insertion can be intercepted by an addon registering the 'enotify_store' hook
+               if (!$notification) {
+                       return false;
+               }
+
                $notification->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $notification->link]);
 
                DI::notify()->update($notification);