From 84e764bf5a6b2b3b431fcc5bd2ebf5f95a303798 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 25 Jul 2022 15:15:14 +0200 Subject: [PATCH] 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 --- apps/dav/lib/CalDAV/BirthdayService.php | 3 +++ 1 file changed, 3 insertions(+) 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) { -- 2.39.5