svn commit: r1062264 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java

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

svn commit: r1062264 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java

mrisaliti
Author: mrisaliti
Date: Sat Jan 22 20:40:52 2011
New Revision: 1062264

URL: http://svn.apache.org/viewvc?rev=1062264&view=rev
Log:
Avoid a null pointer exception

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java?rev=1062264&r1=1062263&r2=1062264&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/data/DataServices.java Sat Jan 22 20:40:52 2011
@@ -213,6 +213,9 @@ public class DataServices {
 
         // obtain a reference to the file
         File file = null;
+        if (UtilValidate.isEmpty(objectInfo)) {
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentUnableObtainReferenceToFile", UtilMisc.toMap("objectInfo", ""), locale));
+        }
         if (UtilValidate.isEmpty(dataResourceTypeId) || dataResourceTypeId.equals("LOCAL_FILE") || dataResourceTypeId.equals("LOCAL_FILE_BIN")) {
             file = new File(objectInfo);
             if (!file.isAbsolute()) {
@@ -264,7 +267,7 @@ public class DataServices {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ContentNoContentFilePassed", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
         }
 
-        Map result = ServiceUtil.returnSuccess();
+        Map<String, Object> result = ServiceUtil.returnSuccess();
         return result;
     }