From a3e775f28cc14cac603c8fff81074b636337f4b1 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 29 Jun 2020 18:58:17 -0400 Subject: [PATCH] Account for false return value of Repository\Notify->insert in notification() - Address https://github.com/friendica/friendica/issues/8473#issuecomment-651393541 --- include/enotify.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/enotify.php b/include/enotify.php index 89a81833d..6b3171dda 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -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);