Commit 44211922 authored by Simon Barner's avatar Simon Barner
Browse files

Avoid NPE in closeEditor()

Issue-Ref: 3818
Issue-Url: https://af3-developer.fortiss.org/issues/3818

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 2ad2e86d
......@@ -5,7 +5,7 @@ ConstraintUIService.java 433e35bb1c9bbc628c6ee070ff45632400becf4a GREEN
ContextMenuService.java ca3c899293f25b70ce8e5f0d86ca2f9683329d81 GREEN
EditPartFactoryService.java e9180c0020f1769d9e24ef3c08f9ca5599dbc5c3 GREEN
MarkerService.java b01b7706034691683df7bbc2e7828c42574b3147 GREEN
ModelEditorBindingService.java 0239c01eef78854fa4abd2df90d93a2b06d60593 GREEN
ModelEditorBindingService.java 948fcdc298a74e366351ad8835a145af6cd238be YELLOW
ModelElementHandlerService.java 07a30545ad687ff0fe13bf7a9348c41fb03e0b2c GREEN
NavigatorService.java 2b1361eac805996e22e5409dafff9707fbac3376 GREEN
ToolingKernelUIInternal.java 38903445a9084b7908716a00f41621dfb3126fca GREEN
......
......@@ -33,6 +33,7 @@ import org.eclipse.ui.IPartService;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.fortiss.tooling.kernel.ToolingKernelActivator;
......@@ -220,12 +221,9 @@ public class ModelEditorBindingService extends EObjectAwareServiceBase<IModelEdi
/** Closes the given editor. */
private void closeEditor(final IEditorPart editor) {
editor.getSite().getShell().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
editor.getSite().getPage().closeEditor(editor, false);
}
});
IWorkbenchPartSite editorSite = editor.getSite();
IWorkbenchPage page = editorSite.getPage();
editorSite.getShell().getDisplay().asyncExec(() -> page.closeEditor(editor, false));
}
/** {@inheritDoc} */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment