]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed null pointer problem from SCLSCriptEditorAdapter 94/894/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sun, 27 Aug 2017 18:11:21 +0000 (21:11 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Sun, 27 Aug 2017 18:11:21 +0000 (21:11 +0300)
refs #7450

Change-Id: Iafa03f216815c5c0f06a8ed27a081cd7db1c71fc

bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/scriptEditor/SCLScriptEditorAdapter.java

index ceb0e584c8711dad1cfbca9e0c101c25b0e02f84..973929974e7a3ed13a91616b9d92642bb1f2baaa 100644 (file)
@@ -58,7 +58,7 @@ public class SCLScriptEditorAdapter extends AbstractResourceEditorAdapter implem
     @Override
     public boolean canHandle(ReadGraph g, Object input) throws DatabaseException {
         Resource resource = toResource(input);
-        return g.isInstanceOf(resource, Layer0.getInstance(g).SCLScript);
+        return resource != null && g.isInstanceOf(resource, Layer0.getInstance(g).SCLScript);
     }
 
     protected void openEditor(Resource input) throws Exception {