]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.ui/src/org/simantics/ui/workbench/ResourceEditorSupport.java
Fixed ResourceEditorSupport.scheduleEditorClose wrong thread invocation
[simantics/platform.git] / bundles / org.simantics.ui / src / org / simantics / ui / workbench / ResourceEditorSupport.java
index 4075e1e11efaec0a6b3161db1bf9cf2b3f67bdba..80e0393cf42e6da121ed96f0e016d5cbf4b836b7 100644 (file)
@@ -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);