]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't try to purge objects from the birthday calendar when it doesn't exist 33365/head
authorThomas Citharel <tcit@tcit.fr>
Mon, 25 Jul 2022 13:15:14 +0000 (15:15 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Tue, 26 Jul 2022 17:29:17 +0000 (17:29 +0000)
Doesn't matter much as it's been recreated afterwards with (ensureCalendarExists).

Closes #29617

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
apps/dav/lib/CalDAV/BirthdayService.php

index bdcf0796283ef669ef58e6ae6a62dc41b3bc3d4b..0ec3e034d256de0d76ce24c61995729c9ada7d96 100644 (file)
@@ -303,6 +303,9 @@ class BirthdayService {
        public function resetForUser(string $user):void {
                $principal = 'principals/users/'.$user;
                $calendar = $this->calDavBackEnd->getCalendarByUri($principal, self::BIRTHDAY_CALENDAR_URI);
+               if (!$calendar) {
+                       return; // The user's birthday calendar doesn't exist, no need to purge it
+               }
                $calendarObjects = $this->calDavBackEnd->getCalendarObjects($calendar['id'], CalDavBackend::CALENDAR_TYPE_CALENDAR);
 
                foreach ($calendarObjects as $calendarObject) {