aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-08-03 11:25:26 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-03 11:25:26 +0200
commitc3acd03a8e0b5426743b0f64f011ba7baa3ddbe5 (patch)
tree735b6f1d0d7929018611fa4ffdae6070b72a0ee7 /apps/files_sharing
parent90bb0a26f4c6a689015a8293c021ef7591933b91 (diff)
downloadnextcloud-server-c3acd03a8e0b5426743b0f64f011ba7baa3ddbe5.tar.gz
nextcloud-server-c3acd03a8e0b5426743b0f64f011ba7baa3ddbe5.zip
fix(notifications): Remove share notification when the node is deleted
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/Notification/Notifier.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/Notification/Notifier.php b/apps/files_sharing/lib/Notification/Notifier.php
index 455d0fd66fc..d339c484dd7 100644
--- a/apps/files_sharing/lib/Notification/Notifier.php
+++ b/apps/files_sharing/lib/Notification/Notifier.php
@@ -29,6 +29,7 @@ declare(strict_types=1);
namespace OCA\Files_Sharing\Notification;
use OCP\Files\IRootFolder;
+use OCP\Files\NotFoundException;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IURLGenerator;
@@ -117,6 +118,13 @@ class Notifier implements INotifier {
throw new AlreadyProcessedException();
}
+ try {
+ $share->getNode();
+ } catch (NotFoundException $e) {
+ // Node is already deleted, so discard the notification
+ throw new AlreadyProcessedException();
+ }
+
if ($notification->getSubject() === 'expiresTomorrow') {
$notification = $this->parseShareExpiration($share, $notification, $l);
} else {