]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/handlers/e4/SyncCurrentTypicalTemplateToInstances.java
Some enhancements made by Antti for multiple readers
[simantics/platform.git] / bundles / org.simantics.modeling.ui / src / org / simantics / modeling / ui / handlers / e4 / SyncCurrentTypicalTemplateToInstances.java
index 0678d5c3b93dd4f996f1b8db983bde8427cd9f8c..cb5b81224a1f0def0e4ea5b3e6ece2ff609e8210 100644 (file)
@@ -40,8 +40,12 @@ public class SyncCurrentTypicalTemplateToInstances {
         }
         if (activeEditor == null)
             return false;
-        IResourceEditorInput input = (IResourceEditorInput) activeEditor.getEditorInput();
-        return TypicalPropertyTester.isTypicalMasterEditor(Simantics.getSession(), input.getResource());
+        if(activeEditor.getEditorInput() instanceof IResourceEditorInput) {
+            IResourceEditorInput input = (IResourceEditorInput) activeEditor.getEditorInput();
+            return TypicalPropertyTester.isTypicalMasterEditor(Simantics.getSession(), input.getResource());
+        } else {
+            return false;
+        }
     }
     
     @Execute