jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1240198 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
Date Fri, 03 Feb 2012 14:49:16 GMT
Author: alexparvulescu
Date: Fri Feb  3 14:49:16 2012
New Revision: 1240198

URL: http://svn.apache.org/viewvc?rev=1240198&view=rev
Log:
JCR-3050 NullPointerException on removing a node acquired from search result

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java?rev=1240198&r1=1240197&r2=1240198&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
Fri Feb  3 14:49:16 2012
@@ -207,7 +207,12 @@ public abstract class ItemState {
      * @throws RepositoryException
      */
     public NodeState getParent() throws ItemNotFoundException, RepositoryException {
-        return getHierarchyEntry().getParent().getNodeState();
+        // safeguard against root node's null parent
+        NodeEntry parent = getHierarchyEntry().getParent();
+        if (parent != null) {
+            return getHierarchyEntry().getParent().getNodeState();
+        }
+        return null;
     }
 
     /**



Mime
View raw message