X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.ui%2Fsrc%2Forg%2Fsimantics%2Fui%2Fworkbench%2FResourceEditorSupport.java;h=80e0393cf42e6da121ed96f0e016d5cbf4b836b7;hp=4075e1e11efaec0a6b3161db1bf9cf2b3f67bdba;hb=39f3d69b2eab08207248a4f00ed6159084326fe0;hpb=416ebcbe9ab63a80636d90445f3ef727b4426f90 diff --git a/bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorSupport.java b/bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorSupport.java index 4075e1e11..80e0393cf 100644 --- a/bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorSupport.java +++ b/bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorSupport.java @@ -311,7 +311,9 @@ public class ResourceEditorSupport implements IAdaptable, ChangeListener { } private static void scheduleEditorClose(IEditorPart editorPart) { - SWTUtils.asyncExec(editorPart.getSite().getShell(), () -> { + if (editorPart == null) + return; + SWTUtils.asyncExec(editorPart.getSite().getWorkbenchWindow().getShell(), () -> { // Don't have to check isDisposed since closeEditor // will ignore already closed editor parts. WorkbenchUtils.closeEditor(editorPart, false);