Fixed: NullPointer Access in CategoryContentWrapper.getProductCategoryContentAsText
when locale parameter is missing
The said method is not nullpointer-safe; it is possible, that the method crashes
and produces a nullpointer-exception at this point:
String sessionLocale = locale.toString();
Thanks: Dennis Balkir
@@ -149,7 +149,7 @@ public class CategoryContentWrapper implements ContentWrapper {
categoryContentList = EntityUtil.filterByDate(categoryContentList);
GenericValue categoryContent = null;
- String sessionLocale = locale.toString();
+ String sessionLocale = (locale != null ? locale.toString() : null);
String fallbackLocale = UtilProperties.getFallbackLocale().toString();
if ( sessionLocale == null ) sessionLocale = fallbackLocale;
// look up all content found for locale
