]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(notifications): Remove share notification when the node is deleted 39689/head
authorJoas Schilling <coding@schilljs.com>
Thu, 3 Aug 2023 09:25:26 +0000 (11:25 +0200)
committerJoas Schilling <coding@schilljs.com>
Thu, 3 Aug 2023 09:25:26 +0000 (11:25 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/files_sharing/lib/Notification/Notifier.php

index 455d0fd66fcf34a6ec853088f6c6a4f0f01f0062..d339c484dd7891c971e329f9d3ca5556d646c665 100644 (file)
@@ -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 {