aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2023-08-01 11:13:59 -0700
committerChristopher Ng <chrng8@gmail.com>2023-08-03 15:30:11 -0700
commitc4b7056f58e3f7773ac95dfc38bf46217b91b8c0 (patch)
tree4c94017bfeff3fa863ee9c4960313c2c70d9841a
parent9e8354e0ac35090995a0451ccd1166f178815ea1 (diff)
downloadnextcloud-server-c4b7056f58e3f7773ac95dfc38bf46217b91b8c0.tar.gz
nextcloud-server-c4b7056f58e3f7773ac95dfc38bf46217b91b8c0.zip
fix: catch NodeNotFoundException in notifier
Signed-off-by: Christopher Ng <chrng8@gmail.com>
-rw-r--r--apps/files_reminders/lib/Notification/Notifier.php7
1 files 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/...