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);
}
}