A patch from Sebastian Leitner "ContentManagementServices throws NullPointerException" https://issues.apache.org/jira/browse/OFBIZ-4751

Fixes a NPE

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1303764 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2012-03-22 12:59:00 +00:00
parent 4bc25aede9
commit 8cfaf4aaf6
@@ -1591,8 +1591,11 @@ public class ContentManagementServices {
Debug.logError(msg, module);
return ServiceUtil.returnError(msg);
}
Long useTime = (Long)productContent.get("useTime");
Integer newUseTime = Integer.valueOf(useTime.intValue() * qty.intValue());
Long useTime = (Long) productContent.get("useTime");
Integer newUseTime = null;
if (UtilValidate.isNotEmpty(useTime)) {
newUseTime = Integer.valueOf(useTime.intValue() * qty.intValue());
}
context.put("useTime", newUseTime);
context.put("useTimeUomId", productContent.get("useTimeUomId"));
context.put("useRoleTypeId", productContent.get("useRoleTypeId"));