Login  Register

svn commit: r1303764 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

svn commit: r1303764 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java

jleroux@apache.org
14119 posts
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"));