summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-08-03 11:25:26 +0200
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2023-08-04 07:52:46 +0000
commitaaa620044c885281f1879313cf71c512ab248c49 (patch)
tree63d308554d993c11c820188a7c18048d54651c9d /apps/files_sharing
parent72c285f4711754ee2ceaa072c33c2a6c89b556d7 (diff)
downloadnextcloud-server-aaa620044c885281f1879313cf71c512ab248c49.tar.gz
nextcloud-server-aaa620044c885281f1879313cf71c512ab248c49.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 {