summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-03-15 21:33:59 (EST)
committerpelder2006-03-15 21:33:59 (EST)
commit07a0d24b3a9572c30b405a27ede4ac1ad96a51d9 (patch)
treea7bf37ebf4cc5075f19198f2086f0eec634108e7
parent482cfbe82ffb579bb1e4cfdee6aa6f9e670dfd90 (diff)
downloadorg.eclipse.jet-07a0d24b3a9572c30b405a27ede4ac1ad96a51d9.zip
org.eclipse.jet-07a0d24b3a9572c30b405a27ede4ac1ad96a51d9.tar.gz
org.eclipse.jet-07a0d24b3a9572c30b405a27ede4ac1ad96a51d9.tar.bz2
Add extra null pointer checking
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Root.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Root.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Root.java
index 3d41a86..29f4245 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Root.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Root.java
@@ -41,8 +41,16 @@ public class Root extends NodeSetExpr
public NodeSet evalAsNodeSet(Context context)
{
Object contextNode = context.getContextNode();
-
+ if (contextNode == null)
+ {
+ return NodeSetImpl.EMPTY_SET;
+ }
+
INodeInspector inspector = context.getContextNodeInspector();
+ if(inspector == null)
+ {
+ return NodeSetImpl.EMPTY_SET;
+ }
Object root = inspector.getDocumentRoot(contextNode);
if (root != null)