From fa7985d0fd78300f7a275fd0e1ab71e487d38a17 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Tue, 1 Aug 2023 11:13:59 -0700 Subject: [PATCH] fix: catch NodeNotFoundException in notifier Signed-off-by: Christopher Ng (cherry picked from commit c4b7056f58e3f7773ac95dfc38bf46217b91b8c0) --- apps/files_reminders/lib/Notification/Notifier.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/files_reminders/lib/Notification/Notifier.php b/apps/files_reminders/lib/Notification/Notifier.php index c7384b43224..08aa8b2d67c 100644 --- a/apps/files_reminders/lib/Notification/Notifier.php +++ b/apps/files_reminders/lib/Notification/Notifier.php @@ -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/...