From 554e2dce48e3d1ec6e7db02a3bccb0b41923e27e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 25 Jul 2022 15:15:14 +0200 Subject: 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(+) (limited to 'apps/dav') diff --git a/apps/dav/lib/CalDAV/BirthdayService.php b/apps/dav/lib/CalDAV/BirthdayService.php index 1030768e26f..6e60f9d932e 100644 --- a/apps/dav/lib/CalDAV/BirthdayService.php +++ b/apps/dav/lib/CalDAV/BirthdayService.php @@ -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) { -- cgit v1.2.3