fix: catch NodeNotFoundException in notifier

Signed-off-by: Christopher Ng <chrng8@gmail.com>
(cherry picked from commit c4b7056f58)
This commit is contained in:
Christopher Ng 2023-08-01 11:13:59 -07:00
parent 6fc3530b4f
commit fa7985d0fd

View file

@ -55,7 +55,6 @@ class Notifier implements INotifier {
/**
* @throws InvalidArgumentException
* @throws NodeNotFoundException
*/
public function prepare(INotification $notification, string $languageCode): INotification {
$l = $this->l10nFactory->get(Application::APP_ID, $languageCode);
@ -73,7 +72,11 @@ class Notifier implements INotifier {
throw new InvalidArgumentException();
}
$node = $reminder->getNode();
try {
$node = $reminder->getNode();
} catch (NodeNotFoundException $e) {
throw new InvalidArgumentException();
}
$path = rtrim($node->getPath(), '/');
if (strpos($path, '/' . $notification->getUser() . '/files/') === 0) {
// Remove /user/files/...