Author: jleroux
Date: Thu Mar 22 12:59:00 2012
New Revision: 1303764
URL:
http://svn.apache.org/viewvc?rev=1303764&view=revLog:
A patch from Sebastian Leitner "ContentManagementServices throws NullPointerException"
https://issues.apache.org/jira/browse/OFBIZ-4751Fixes a NPE
Modified:
ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java
Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=1303764&r1=1303763&r2=1303764&view=diff==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Thu Mar 22 12:59:00 2012
@@ -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"));