jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1300996 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
Date Thu, 15 Mar 2012 14:20:27 GMT
Author: mduerig
Date: Thu Mar 15 14:20:27 2012
New Revision: 1300996

URL: http://svn.apache.org/viewvc?rev=1300996&view=rev
Log:
OAK-5: JCR bindings for Oak
- fix NPE in PropertyImpl#getRequiredType

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java?rev=1300996&r1=1300995&r2=1300996&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
Thu Mar 15 14:20:27 2012
@@ -543,7 +543,8 @@ public class PropertyImpl extends ItemIm
      */
     private int getRequiredType(int defaultType) throws RepositoryException {
         // check type according to definition of this property
-        int reqType = getDefinition().getRequiredType();
+        PropertyDefinition def = getDefinition();
+        int reqType = def == null ? PropertyType.UNDEFINED : getDefinition().getRequiredType();
         if (reqType == PropertyType.UNDEFINED) {
             if (defaultType == PropertyType.UNDEFINED) {
                 reqType = PropertyType.STRING;



Mime
View raw message