From: Thomas Citharel Date: Mon, 25 Jul 2022 13:15:14 +0000 (+0200) Subject: Don't try to purge objects from the birthday calendar when it doesn't exist X-Git-Tag: v23.0.8rc1~15^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=84e764bf5a6b2b3b431fcc5bd2ebf5f95a303798;p=nextcloud-server.git Don't try to purge objects from the birthday calendar when it doesn't exist Doesn't matter much as it's been recreated afterwards with (ensureCalendarExists). Closes #29617 Signed-off-by: Thomas Citharel --- diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index bdcf0796283..0ec3e034d25 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -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) {