]> source.dussan.org Git - nextcloud-server.git/commitdiff
Discard share notification for non-existing groups 30281/head
authorVincent Petry <vincent@nextcloud.com>
Wed, 15 Dec 2021 13:25:39 +0000 (14:25 +0100)
committerVincent Petry <vincent@nextcloud.com>
Wed, 15 Dec 2021 13:55:27 +0000 (14:55 +0100)
Group shares might exist even after a group got deleted.

This fix catches the situation and discards the notification for the
obsolete group.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Co-authored-by: Joas Schilling <coding@schilljs.com>
apps/files_sharing/lib/Notification/Notifier.php

index 7d79165dd26dcf1363f90d5caec08694750c8114..d35e22c935d2ea009261e8903df07b5225d5df2f 100644 (file)
@@ -192,7 +192,7 @@ class Notifier implements INotifier {
                                }
 
                                $group = $this->groupManager->get($share->getSharedWith());
-                               if (!$group->inGroup($user)) {
+                               if ($group === null || !$group->inGroup($user)) {
                                        throw new AlreadyProcessedException();
                                }