You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2012/03/22 13:59:00 UTC
svn commit: r1303764 -
/ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java
Author: jleroux
Date: Thu Mar 22 12:59:00 2012
New Revision: 1303764
URL: http://svn.apache.org/viewvc?rev=1303764&view=rev
Log:
A patch from Sebastian Leitner "ContentManagementServices throws NullPointerException" https://issues.apache.org/jira/browse/OFBIZ-4751
Fixes 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"));