chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1576870 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
Date Wed, 12 Mar 2014 19:53:02 GMT
Author: jens
Date: Wed Mar 12 19:53:02 2014
New Revision: 1576870

URL: http://svn.apache.org/r1576870
Log:
Avoid NPE in TypeValidator when verifying properties and no type id is given

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

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java?rev=1576870&r1=1576869&r2=1576870&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
Wed Mar 12 19:53:02 2014
@@ -255,6 +255,9 @@ public final class TypeValidator {
         if (properties != null) {
             for (PropertyData<?> prop : properties.getProperties().values()) {
                 String propertyId = prop.getId();
+                if (null == propertyId) {
+                    throw new CmisInvalidArgumentException("Property id cannot be null");
+                }                
                 BaseTypeId baseTypeId = typeDef.getBaseTypeId();
 
                 // check that all mandatory attributes are present
@@ -300,6 +303,9 @@ public final class TypeValidator {
 
             for (PropertyData<?> prop : properties.getProperties().values()) {
                 String propertyId = prop.getId();
+                if (null == propertyId) {
+                    throw new CmisInvalidArgumentException("Property id cannot be null");
+                }
                 BaseTypeId baseTypeId = typeDef.getBaseTypeId();
 
                 // check that all mandatory attributes are present



Mime
View raw message