chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r928744 - /incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-support/src/main/java/org/apache/opencmis/server/support/ObjectInfoHelper.java
Date Mon, 29 Mar 2010 12:08:57 GMT
Author: jens
Date: Mon Mar 29 12:08:57 2010
New Revision: 928744

URL: http://svn.apache.org/viewvc?rev=928744&view=rev
Log:
Avoid NPE if children list of a folder is empty

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-support/src/main/java/org/apache/opencmis/server/support/ObjectInfoHelper.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-support/src/main/java/org/apache/opencmis/server/support/ObjectInfoHelper.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-support/src/main/java/org/apache/opencmis/server/support/ObjectInfoHelper.java?rev=928744&r1=928743&r2=928744&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-support/src/main/java/org/apache/opencmis/server/support/ObjectInfoHelper.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-support/src/main/java/org/apache/opencmis/server/support/ObjectInfoHelper.java
Mon Mar 29 12:08:57 2010
@@ -348,7 +348,7 @@ public class ObjectInfoHelper
         ObjectInFolderList objList,
         ObjectInfoHolder objectInfos)
     {
-        if (null == objectInfos || null == objList)
+        if (null == objectInfos || null == objList || objList.getObjects() == null)
             return;
 
         // Fill object information for all children in result list
@@ -405,7 +405,6 @@ public class ObjectInfoHelper
     {
         if (null == objectInfos || null == oifcList)
             return;
-
           
         for (ObjectInFolderContainer object : oifcList) {
             fillObjectInfoHolderFolderContainer(context, repositoryId, object, objectInfos);
@@ -418,16 +417,17 @@ public class ObjectInfoHelper
         ObjectInFolderContainer oifc,
         ObjectInfoHolder objectInfos)
     {
-        if (null == objectInfos || null == oifc)
-            return;
-
-        fillObjectInfoHolder(context, repositoryId, oifc.getObject().getObject(), objectInfos);
-
-        if (null!=oifc.getChildren())
-            for (ObjectInFolderContainer object : oifc.getChildren()) {
-                // call recursively
-                fillObjectInfoHolderFolderContainer(context, repositoryId, object, objectInfos);
-            }    
+      if (null == objectInfos || null == oifc || oifc.getObject() == null
+          || oifc.getObject().getObject() == null)
+        return;
+
+      fillObjectInfoHolder(context, repositoryId, oifc.getObject().getObject(), objectInfos);
+
+      if (null!=oifc.getChildren())
+        for (ObjectInFolderContainer object : oifc.getChildren()) {
+          // call recursively
+          fillObjectInfoHolderFolderContainer(context, repositoryId, object, objectInfos);
+        }    
     }
 
     private Boolean getBooleanProperty(Map<String, PropertyData<?>> props, String
key) {



Mime
View raw message