Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2008-02-05 18:50:41 +0000
committerpelder2008-02-05 18:50:41 +0000
commitbb3f2e9c7fc7073be762369860c726db2b30a6b7 (patch)
tree966f170402ce42d09c9be4987279d41da6bb0105
parent82931df8c37de9e8323727e27ff5f28008b861b7 (diff)
downloadorg.eclipse.jet-bb3f2e9c7fc7073be762369860c726db2b30a6b7.tar.gz
org.eclipse.jet-bb3f2e9c7fc7073be762369860c726db2b30a6b7.tar.xz
org.eclipse.jet-bb3f2e9c7fc7073be762369860c726db2b30a6b7.zip
[217057] NullPointer exception when use specified schema
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java2
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java
index 039ee9f..e9f4b4c 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Axis.java
@@ -116,7 +116,7 @@ public abstract class Axis
NodeSet result = NodeSetImpl.EMPTY_SET;
final Object contextNode = context.getContextNode();
INodeInspector inspector = context.getContextNodeInspector();
- if (inspector.getNodeKind(contextNode) == INodeInspector.NodeKind.ELEMENT && inspector instanceof IElementInspector)
+ if (inspector instanceof IElementInspector && inspector.getNodeKind(contextNode) == INodeInspector.NodeKind.ELEMENT)
{
// getAttributes only applies to ELEMENTs
IElementInspector elementInspector = (IElementInspector)inspector;
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
index 0b93ecb..5475182 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/inspectors/EObjectInspector.java
@@ -803,6 +803,9 @@ public class EObjectInspector implements IElementInspector, INodeInspectorExtens
private Object[] getFeatureValue(EObject eObject, EStructuralFeature feature)
{
Object objResult = eObject.eGet(feature);
+ if(objResult == null) {
+ return new Object[] {};
+ }
if(feature instanceof EReference) {
if(feature.isMany()) {
return ((List)objResult).toArray();

Back to the top