summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2016-02-02 17:01:32 -0500
committerKarsten Thoms2016-02-02 17:01:32 -0500
commit773b6cadc8c3ff4d6a2356726093b93fb0a4fe2c (patch)
treec0678984fb6b62ecd9be7a4d88d6260026a82985
parenta15709a102f4ab059655c48c4cb7ee2fa8263082 (diff)
downloadorg.eclipse.xpand-773b6cadc8c3ff4d6a2356726093b93fb0a4fe2c.zip
org.eclipse.xpand-773b6cadc8c3ff4d6a2356726093b93fb0a4fe2c.tar.gz
org.eclipse.xpand-773b6cadc8c3ff4d6a2356726093b93fb0a4fe2c.tar.xz
[482602] Avoid NPE for breakpoints on comments and definesHEADmaster
Change-Id: Id06775926a54082371a1a125335cfac710be2c8e Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
-rw-r--r--plugins/org.eclipse.xpand.ui/src/org/eclipse/xpand/ui/debug/XpandPluginAdapter.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/org.eclipse.xpand.ui/src/org/eclipse/xpand/ui/debug/XpandPluginAdapter.java b/plugins/org.eclipse.xpand.ui/src/org/eclipse/xpand/ui/debug/XpandPluginAdapter.java
index 9bbe53c..8f45c9d 100644
--- a/plugins/org.eclipse.xpand.ui/src/org/eclipse/xpand/ui/debug/XpandPluginAdapter.java
+++ b/plugins/org.eclipse.xpand.ui/src/org/eclipse/xpand/ui/debug/XpandPluginAdapter.java
@@ -15,6 +15,7 @@ import static org.eclipse.internal.xpand2.debug.XpandElementAdapter.TYPE;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.eclipse.core.resources.IResource;
@@ -96,6 +97,8 @@ public class XpandPluginAdapter extends ExpressionPluginAdapter {
@Override
protected List<ISyntaxElement> collectFirstLevelElements(
final IXtendXpandResource res) {
+ if (res == null)
+ return Collections.emptyList();
List<ISyntaxElement> result = new ArrayList<ISyntaxElement>();
XpandDefinition[] defs = ((Template) res.getExtXptResource())
.getDefinitions();
@@ -213,6 +216,8 @@ public class XpandPluginAdapter extends ExpressionPluginAdapter {
break;
}
}
+ if (element == null)
+ return rootElem;
return getContainingElement((SyntaxElement) element, position);
}