From 39f3d69b2eab08207248a4f00ed6159084326fe0 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Mon, 3 Jul 2017 18:44:05 +0300 Subject: [PATCH] Fixed ResourceEditorSupport.scheduleEditorClose wrong thread invocation Now using safer means to gain access to an editor's containing shell than previously. refs #7349 Change-Id: I0c5ff9711703608fd34a17cc474ed9490e5ab4d5 --- .../src/org/simantics/ui/workbench/ResourceEditorSupport.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.47.1