jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1360153 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Date Wed, 11 Jul 2012 12:49:31 GMT
Author: reschke
Date: Wed Jul 11 12:49:30 2012
New Revision: 1360153

URL: http://svn.apache.org/viewvc?rev=1360153&view=rev
Log:
fix potential NPEs

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1360153&r1=1360152&r2=1360153&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Wed Jul 11 12:49:30 2012
@@ -1093,6 +1093,9 @@ public class NodeImpl extends ItemImpl i
             CoreValueFactory factory = session.getCoreValueFactory();
             Root root = session.getCurrentRoot();
             Tree tree = root.getTree(dlg.getPath());
+            if (tree == null) {
+                throw new ItemNotFoundException();
+            }
             tree.setProperty(lockOwner, factory.createValue(userID));
             tree.setProperty(lockIsDeep, factory.createValue(isDeep));
             root.commit(DefaultConflictHandler.OURS); // TODO: fail instead?
@@ -1114,6 +1117,9 @@ public class NodeImpl extends ItemImpl i
         try {
             Root root = sessionDelegate.getContentSession().getCurrentRoot();
             Tree tree = root.getTree(dlg.getPath());
+            if (tree == null) {
+                throw new ItemNotFoundException();
+            }
             tree.removeProperty(lockOwner);
             tree.removeProperty(lockIsDeep);
             root.commit(DefaultConflictHandler.OURS);



Mime
View raw message