jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1346866 - /jackrabbit/branches/2.4/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
Date Wed, 06 Jun 2012 12:58:28 GMT
Author: alexparvulescu
Date: Wed Jun  6 12:58:27 2012
New Revision: 1346866

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

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

Modified: jackrabbit/branches/2.4/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.4/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java?rev=1346866&r1=1346865&r2=1346866&view=diff
==============================================================================
--- jackrabbit/branches/2.4/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
(original)
+++ jackrabbit/branches/2.4/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
Wed Jun  6 12:58:27 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