Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
i18n 2.5.4
-
None
-
Patch
Description
According to the JEE API, the ServletRequest#getLocale should never return null, the ultimate fallback being the default locale for the server.
However, the Sling wrapper o.a.s.i.i.I18NFilter.I18NHttpServletRequest#getLocale may return null in case:
1. the localeResolver does return empty list (allowed as per API)
2. The bundleProvider#getDefaultLocale returns null (not clear if allowed or not)
With the current Sling code, 2. can occurs at https://github.com/apache/sling/blob/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/I18NFilter.java#L198