From 074b7771a3d6697f0468965c2858998eb9ef21b6 Mon Sep 17 00:00:00 2001 From: Timotei Dolean Date: Wed, 26 May 2010 11:40:18 +0000 Subject: [PATCH] eclipse plugin: let's return the first Workbench Window... ...if we have any rather then the active one that might be 'null' --- .../src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java b/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java index 7b2a67b42b8..de89fcdbba4 100644 --- a/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java +++ b/utils/java/eclipse_plugin/src/wesnoth_eclipse_plugin/utils/WorkspaceUtils.java @@ -54,6 +54,8 @@ public class WorkspaceUtils } public static IWorkbenchWindow getWorkbenchWindow() { - return Activator.getDefault().getWorkbench().getActiveWorkbenchWindow(); + if (Activator.getDefault().getWorkbench().getWorkbenchWindowCount() == 0) + return null; + return Activator.getDefault().getWorkbench().getWorkbenchWindows()[0]; } }