diff --git a/lib/Service/Appointments/TimezoneGenerator.php b/lib/Service/Appointments/TimezoneGenerator.php
index 308a783949..36bb7fe80f 100644
--- a/lib/Service/Appointments/TimezoneGenerator.php
+++ b/lib/Service/Appointments/TimezoneGenerator.php
@@ -48,6 +48,7 @@
namespace OCA\Calendar\Service\Appointments;
+use Sabre\VObject\Component;
use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VTimeZone;
use Sabre\VObject\TimeZoneUtil;
@@ -132,7 +133,7 @@ public function generateVtimezone(string $timezone, int $from, int $to): ?VTimeZ
// add X-MICROSOFT-CDO-TZID if available
$microsoftExchangeMap = array_flip(TimeZoneUtil::$microsoftExchangeMap);
- if (array_key_exists($tz->getName(), $microsoftExchangeMap)) {
+ if (!empty($microsoftExchangeMap) && array_key_exists($tz->getName(), $microsoftExchangeMap)) {
$vtimezone->add('X-MICROSOFT-CDO-TZID', $microsoftExchangeMap[$tz->getName()]);
}
diff --git a/psalm.xml b/psalm.xml
index 0575c0df0f..46aa449516 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -30,6 +30,7 @@
+