]> source.dussan.org Git - nextcloud-server.git/commitdiff
Discard share notification for non-existing groups 30308/head
authorVincent Petry <vincent@nextcloud.com>
Wed, 15 Dec 2021 13:25:39 +0000 (14:25 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Fri, 17 Dec 2021 07:09:28 +0000 (07:09 +0000)
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 2499896653b0de16e7e92765e66e8f63a17862ab..22cf83b547737551919299476bf576914125efbb 100644 (file)
@@ -193,7 +193,7 @@ class Notifier implements INotifier {
                                }
 
                                $group = $this->groupManager->get($share->getSharedWith());
-                               if (!$group->inGroup($user)) {
+                               if ($group === null || !$group->inGroup($user)) {
                                        throw new AlreadyProcessedException();
                                }