Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-07-10 05:38:21 -0400
committerUwe Stieber2013-07-10 05:48:14 -0400
commit0e73c33cabb6e0eda3557a37904435d62ecbaa2c (patch)
treec2dafe973129143b7ab2a4c343f38e9aefe08984 /plugins
parent9b8081a48a9819bac92cefe2af39a28e0aaf6633 (diff)
downloadorg.eclipse.tcf-0e73c33cabb6e0eda3557a37904435d62ecbaa2c.tar.gz
org.eclipse.tcf-0e73c33cabb6e0eda3557a37904435d62ecbaa2c.tar.xz
org.eclipse.tcf-0e73c33cabb6e0eda3557a37904435d62ecbaa2c.zip
UI: Fix usage of "HandlerUtil.getActiveWorkbenchWindow(event)" backed up
in case it returns null
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/AbstractActionDelegate.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/AbstractActionDelegate.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/AbstractActionDelegate.java
index d4e89b1dc..33d4a861e 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/AbstractActionDelegate.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/AbstractActionDelegate.java
@@ -147,9 +147,11 @@ public abstract class AbstractActionDelegate extends EventManager implements
}
public IWorkbenchWindow getWindow() {
- if (event != null) return HandlerUtil.getActiveWorkbenchWindow(event);
+ // In Eclipse 4.x, the HandlerUtil.getActiveWorkbenchWindow(event) may return null
+ if (event != null && HandlerUtil.getActiveWorkbenchWindow(event) != null) return HandlerUtil.getActiveWorkbenchWindow(event);
if (part != null) return part.getSite().getWorkbenchWindow();
if (window != null) return window;
+ if (PlatformUI.getWorkbench() != null) return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
return null;
}

Back to the top