aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-08-04 09:39:24 +0200
committerGitHub <noreply@github.com>2023-08-04 09:39:24 +0200
commitf8bd676154f988ef2130ccb0e29b0cc95e42a204 (patch)
tree71e6e9fef2d8ca53ac8c575de7965b683696c915 /apps
parent149ddf43aa493c143a7a09ee5d3a0ef118e9b31e (diff)
parentc3acd03a8e0b5426743b0f64f011ba7baa3ddbe5 (diff)
downloadnextcloud-server-f8bd676154f988ef2130ccb0e29b0cc95e42a204.tar.gz
nextcloud-server-f8bd676154f988ef2130ccb0e29b0cc95e42a204.zip
Merge pull request #39689 from nextcloud/bugfix/39135/remove-share-notifications-for-deleted-nodes
fix(notifications): Remove share notification when the node is deleted
Diffstat (limited to 'apps')
-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 {