From a21b4f233179343ea8954ad6d4badad1276bc7a1 Mon Sep 17 00:00:00 2001 From: Marc Dumais Date: Wed, 2 Mar 2016 11:08:18 -0500 Subject: [PATCH] Bug 488874 - attach dialog sometimes does not appear, because no active shell is found Change-Id: I039c90677152efe1611049d11cd9b6102c99f86b --- .../cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java index acb95c231e8..4b2de740547 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/commands/GdbConnectCommand.java @@ -71,7 +71,6 @@ import org.eclipse.debug.core.IRequest; import org.eclipse.debug.core.commands.IDebugCommandRequest; import org.eclipse.debug.core.commands.IEnabledStateRequest; import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.progress.UIJob; @@ -222,7 +221,8 @@ public class GdbConnectCommand extends RefreshableDebugCommand implements IConne if (binaryPath == null) { // prompt for the binary path - Shell shell = Display.getCurrent().getActiveShell(); + Shell shell = GdbUIPlugin.getShell(); + if (shell != null) { FileDialog fd = new FileDialog(shell, SWT.NONE); fd.setText(fTitle);