jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1341896 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
Date Wed, 23 May 2012 15:29:58 GMT
Author: reschke
Date: Wed May 23 15:29:57 2012
New Revision: 1341896

URL: http://svn.apache.org/viewvc?rev=1341896&view=rev
Log:
OAK-37: fix potential null deref (WIP)

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java?rev=1341896&r1=1341895&r2=1341896&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
Wed May 23 15:29:57 2012
@@ -21,6 +21,8 @@ package org.apache.jackrabbit.oak.jcr.qu
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
+
+import javax.annotation.CheckForNull;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
@@ -113,9 +115,10 @@ public class QueryResultImpl implements 
         return new RowIteratorAdapter(it);
     }
 
+    @CheckForNull
     NodeImpl getNode(String path) {
         NodeDelegate d = sessionDelegate.getNode(path);
-        return new NodeImpl(d);
+        return d == null ? null : new NodeImpl(d);
     }
 
     String getLocalPath(String path) {



Mime
View raw message