From 022b6be97fcf25d2725f98ef920594d64e9fe189 Mon Sep 17 00:00:00 2001 From: Hamza Mahjoubi Date: Thu, 4 Jul 2024 10:49:33 +0200 Subject: [PATCH] fix: check if userId is null Signed-off-by: Hamza Mahjoubi --- lib/Service/CalendarInitialStateService.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Service/CalendarInitialStateService.php b/lib/Service/CalendarInitialStateService.php index fa590edb4..d6dab613c 100644 --- a/lib/Service/CalendarInitialStateService.php +++ b/lib/Service/CalendarInitialStateService.php @@ -93,7 +93,9 @@ public function run(): void { $this->initialStateService->provideInitialState('tasks_enabled', $tasksEnabled); $this->initialStateService->provideInitialState('hide_event_export', $hideEventExport); $this->initialStateService->provideInitialState('force_event_alarm_type', $forceEventAlarmType); - $this->initialStateService->provideInitialState('appointmentConfigs', $this->appointmentConfigService->getAllAppointmentConfigurations($this->userId)); + if (!is_null($this->userId)) { + $this->initialStateService->provideInitialState('appointmentConfigs', $this->appointmentConfigService->getAllAppointmentConfigurations($this->userId)); + } $this->initialStateService->provideInitialState('disable_appointments', $disableAppointments); $this->initialStateService->provideInitialState('can_subscribe_link', $canSubscribeLink); $this->initialStateService->provideInitialState('show_resources', $showResources);