Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2008-02-05 15:41:41 -0500
committerpelder2008-02-05 15:41:41 -0500
commitc2e0a2582cd53e17066cca547123e5b3403e3474 (patch)
tree4467f57fac461cb41a55a48563b904eca46145b3
parent2357232f90b8060b360451637c7d3dab196d3618 (diff)
downloadorg.eclipse.jet-c2e0a2582cd53e17066cca547123e5b3403e3474.tar.gz
org.eclipse.jet-c2e0a2582cd53e17066cca547123e5b3403e3474.tar.xz
org.eclipse.jet-c2e0a2582cd53e17066cca547123e5b3403e3474.zip
[217904] 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..f9e75cc 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[0];
+ }
if(feature instanceof EReference) {
if(feature.isMany()) {
return ((List)objResult).toArray();

Back to the top