From 29dafd9fe6fc7725db5f24a3e2485a962caa0138 Mon Sep 17 00:00:00 2001 From: mhaug Date: Fri, 22 Nov 2024 13:50:40 +0100 Subject: [PATCH] Fix site not available issue --- .../dictionary/i18nsystem/DictionaryTranslationServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magnolia-dictionary/src/main/java/com/namics/oss/magnolia/dictionary/i18nsystem/DictionaryTranslationServiceImpl.java b/magnolia-dictionary/src/main/java/com/namics/oss/magnolia/dictionary/i18nsystem/DictionaryTranslationServiceImpl.java index 2bedcb0..5cb960f 100644 --- a/magnolia-dictionary/src/main/java/com/namics/oss/magnolia/dictionary/i18nsystem/DictionaryTranslationServiceImpl.java +++ b/magnolia-dictionary/src/main/java/com/namics/oss/magnolia/dictionary/i18nsystem/DictionaryTranslationServiceImpl.java @@ -104,7 +104,7 @@ protected Optional doGetMessage(final String[] keys, final Locale locale } private Optional getSiteFallbackLocale() { - return Optional.of(siteManager.getCurrentSite()) + return Optional.ofNullable(siteManager.getCurrentSite()) .map(Site::getI18n) .map(I18nContentSupport::getFallbackLocale); }