Author: mrisaliti
Date: Sat Jan 22 20:07:24 2011
New Revision: 1062250
URL:
http://svn.apache.org/viewvc?rev=1062250&view=revLog:
Avoid a null pointer exception
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=1062250&r1=1062249&r2=1062250&view=diff==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/ContentManagementServices.java Sat Jan 22 20:07:24 2011
@@ -673,7 +673,9 @@ public class ContentManagementServices {
if (hasData) {
fileContext.put("rootDir", context.get("rootDir"));
fileContext.put("dataResourceTypeId", dataResourceTypeId);
- fileContext.put("objectInfo", dataResource.get("objectInfo"));
+ if (UtilValidate.isNotEmpty(dataResource) && UtilValidate.isNotEmpty(dataResource.get("objectInfo"))) {
+ fileContext.put("objectInfo", dataResource.get("objectInfo"));
+ }
thisResult = dispatcher.runSync("createFile", fileContext);
errorMsg = ServiceUtil.getErrorMessage(thisResult);
if (UtilValidate.isNotEmpty(errorMsg)) {