aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-07-26 19:22:56 +0200
committerGitHub <noreply@github.com>2022-07-26 19:22:56 +0200
commit25d2099fce766016fb9dd14ff4b7bb76586d2d74 (patch)
tree56056b1a2303c90172228ad5953959e85e2dbaf5
parentbbe99e65e7f9c18336d6b7818f57584c3f3623e7 (diff)
parent554e2dce48e3d1ec6e7db02a3bccb0b41923e27e (diff)
downloadnextcloud-server-25d2099fce766016fb9dd14ff4b7bb76586d2d74.tar.gz
nextcloud-server-25d2099fce766016fb9dd14ff4b7bb76586d2d74.zip
Merge pull request #33341 from nextcloud/fix/29617/no-purge-when-birthday-calendar-doesnt-exist
Don't try to purge objects from the birthday calendar when it doesn't exist
-rw-r--r--apps/dav/lib/CalDAV/BirthdayService.php3
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) {