Details
-
Type:
Bug
-
Status:
In Review
-
Priority:
Trivial
-
Resolution: Unresolved
-
Affects Version/s: 6.1.1 CE GA2, 6.2.0 CE M5
-
Fix Version/s: None
-
Component/s: WCM, WCM > Staging
-
Labels:None
-
Similar Issues:
Description
There is a possibility for NPE in com.liferay.portal.lar.LayoutExporter:
Code starts from 388 line:
if ((layoutIds == null) || (layoutIds.length == 0))
else
{ layouts = LayoutLocalServiceUtil.getLayouts( groupId, privateLayout, layoutIds); }List<Portlet> portlets = getAlwaysExportablePortlets(companyId);
long plid = LayoutConstants.DEFAULT_PLID;
So, if LayoutLocalServiceUtil.getLayouts will return the null then here (line 400) will be NPE
if (!layouts.isEmpty()) {

The javadoc is incorrect it will always return a list even if empty one.