commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r617893 - /commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/ChildContext.java
Date Sat, 02 Feb 2008 20:54:02 GMT
Author: mbenson
Date: Sat Feb  2 12:54:00 2008
New Revision: 617893

URL: http://svn.apache.org/viewvc?rev=617893&view=rev
Log:
[JXPATH-113] avoid NPE in ChildContext

Modified:
    commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/ChildContext.java

Modified: commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/ChildContext.java
URL: http://svn.apache.org/viewvc/commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/ChildContext.java?rev=617893&r1=617892&r2=617893&view=diff
==============================================================================
--- commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/ChildContext.java
(original)
+++ commons/proper/jxpath/trunk/src/java/org/apache/commons/jxpath/ri/axes/ChildContext.java
Sat Feb  2 12:54:00 2008
@@ -127,7 +127,8 @@
         if (parent == null) {
             return;
         }
-        iterator = (startFromParentLocation ? parent.getParent() : parent).childIterator(nodeTest,
+        NodePointer useParent = startFromParentLocation ? parent.getParent() : parent;
+        iterator = parent == null ? null : useParent.childIterator(nodeTest,
                 reverse, startFromParentLocation ? parent : null);
     }
 }



Mime
View raw message