Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian de Alwis2012-02-14 17:23:53 -0500
committerBrian de Alwis2012-02-14 17:23:53 -0500
commit64aa94ad28cd2ad5a2621aba11f73ed5cf087343 (patch)
treef8a6fa5bcc149484da30bb3c72e886bd4a0f53a6
parentc68d805b69bd6c2cc50ce2f3ac75b49c4ac91db7 (diff)
downloadorg.eclipse.e4.tools-64aa94ad28cd2ad5a2621aba11f73ed5cf087343.tar.gz
org.eclipse.e4.tools-64aa94ad28cd2ad5a2621aba11f73ed5cf087343.tar.xz
org.eclipse.e4.tools-64aa94ad28cd2ad5a2621aba11f73ed5cf087343.zip
Bequinox/rt.equinox.p2.gitug 371548 - [Model Editor] Model editor throws exception when used via File > Open File...
-rw-r--r--bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/E4WorkbenchModelEditor.java2
-rw-r--r--bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/EditorProjectFunction.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/E4WorkbenchModelEditor.java b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/E4WorkbenchModelEditor.java
index eff3aa3a..370dfb9c 100644
--- a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/E4WorkbenchModelEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/E4WorkbenchModelEditor.java
@@ -66,7 +66,7 @@ public class E4WorkbenchModelEditor extends
if (redoAction != null)
redoAction.dispose();
- if (listener != null && getComponent().getModelProvider() != null)
+ if (listener != null && getComponent() != null && getComponent().getModelProvider() != null)
getComponent().getModelProvider().removeModelListener(listener);
super.dispose();
diff --git a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/EditorProjectFunction.java b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/EditorProjectFunction.java
index c99606b5..742cb743 100644
--- a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/EditorProjectFunction.java
+++ b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/EditorProjectFunction.java
@@ -10,7 +10,7 @@ public class EditorProjectFunction extends ContextFunction {
@Override
public Object compute(IEclipseContext context) {
final IEditorInput input = context.get(IEditorInput.class);
- if( input != null ) {
+ if( input != null && input instanceof IFileEditorInput ) {
return ((IFileEditorInput)input).getFile().getProject();
}
return null;

Back to the top