From 8cfaf4aaf6e291943dcbd2647f8eba0ffbc7d71e Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Thu, 22 Mar 2012 12:59:00 +0000 Subject: [PATCH] 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 --- .../src/org/ofbiz/content/ContentManagementServices.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/applications/content/src/org/ofbiz/content/ContentManagementServices.java b/applications/content/src/org/ofbiz/content/ContentManagementServices.java index 2d77ff8599..3b224bf012 100644 --- a/applications/content/src/org/ofbiz/content/ContentManagementServices.java +++ b/applications/content/src/org/ofbiz/content/ContentManagementServices.java @@ -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"));