]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't try to purge objects from the birthday calendar when it doesn't exist 33341/head
authorThomas Citharel <tcit@tcit.fr>
Mon, 25 Jul 2022 13:15:14 +0000 (15:15 +0200)
committerThomas Citharel <tcit@tcit.fr>
Mon, 25 Jul 2022 15:56:24 +0000 (17:56 +0200)
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 1030768e26f452ab0dfd2c7c4db170443d843794..6e60f9d932e6fc1819ac0e73ae7839bda11b9e1f 100644 (file)
@@ -273,6 +273,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) {