From: Tuukka Lehtonen Date: Sun, 27 Aug 2017 18:11:21 +0000 (+0300) Subject: Fixed null pointer problem from SCLSCriptEditorAdapter X-Git-Tag: v1.31.0~215 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=156e5c9618f0a8bd76eaa7c9195803599ecf7a4d;p=simantics%2Fplatform.git Fixed null pointer problem from SCLSCriptEditorAdapter refs #7450 Change-Id: Iafa03f216815c5c0f06a8ed27a081cd7db1c71fc --- diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/scriptEditor/SCLScriptEditorAdapter.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/scriptEditor/SCLScriptEditorAdapter.java index ceb0e584c..973929974 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/scriptEditor/SCLScriptEditorAdapter.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/scl/scriptEditor/SCLScriptEditorAdapter.java @@ -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 {