diff options
author | Thomas Citharel <tcit@tcit.fr> | 2022-07-25 15:15:14 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2022-07-25 17:56:24 +0200 |
commit | 554e2dce48e3d1ec6e7db02a3bccb0b41923e27e (patch) | |
tree | 269b8550f8a837c6f66bff32b28ede001205f9fd /apps/dav | |
parent | 0a956e2b957fef5a895217c7b7bcff7569c7c2c5 (diff) | |
download | nextcloud-server-554e2dce48e3d1ec6e7db02a3bccb0b41923e27e.tar.gz nextcloud-server-554e2dce48e3d1ec6e7db02a3bccb0b41923e27e.zip |
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 <tcit@tcit.fr>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/CalDAV/BirthdayService.php | 3 |
1 files changed, 3 insertions, 0 deletions
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) { |