Merge pull request #8831 from MrPetovan/bug/fatal-errors

Account for false return value of Repository\Notify->insert in notification()
This commit is contained in:
Michael Vogel 2020-06-30 07:57:23 +02:00 committed by GitHub
commit 75519a7bd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -479,6 +479,11 @@ function notification($params)
'otype' => $params['otype'] ?? '', '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]); $notification->msg = Renderer::replaceMacros($epreamble, ['$itemlink' => $notification->link]);
DI::notify()->update($notification); DI::notify()->update($notification);