From 0e73c33cabb6e0eda3557a37904435d62ecbaa2c Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Wed, 10 Jul 2013 11:38:21 +0200 Subject: UI: Fix usage of "HandlerUtil.getActiveWorkbenchWindow(event)" backed up in case it returns null --- .../tcf/internal/debug/ui/commands/AbstractActionDelegate.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins') 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; } -- cgit v1.2.3