From 8a4b4235ac862393ccd77bcec7b2f4ee422ce33e Mon Sep 17 00:00:00 2001 From: "John R. D'Orazio" Date: Thu, 28 Nov 2024 22:53:58 +0100 Subject: [PATCH] only retrieve names for existing i18n keys --- src/Paths/RegionalData.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Paths/RegionalData.php b/src/Paths/RegionalData.php index d2e0ee9c..390b37b5 100644 --- a/src/Paths/RegionalData.php +++ b/src/Paths/RegionalData.php @@ -162,7 +162,9 @@ private function getRegionalCalendar(): void if (file_exists($CalendarDataI18nFile)) { $localeData = json_decode(file_get_contents($CalendarDataI18nFile)); foreach ($CalendarData->litcal as $idx => $el) { - $CalendarData->litcal[$idx]->festivity->name = $localeData->{$CalendarData->litcal[$idx]->festivity->event_key}; + if (property_exists($localeData, $CalendarData->litcal[$idx]->festivity->event_key)) { + $CalendarData->litcal[$idx]->festivity->name = $localeData->{$CalendarData->litcal[$idx]->festivity->event_key}; + } } } else { self::produceErrorResponse(StatusCode::NOT_FOUND, "file $CalendarDataI18nFile does not exist");