mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-03-28 14:56:28 +01:00
Fix NPE if Launch Dialog not open yet (#561)
Some flows (such as open JUnit test case) does a IRunnableContext.run before the UI is open. Therefore we need to fall back on the platform progress service to run it since the launch config UI is not ready yet Fixes #555
This commit is contained in:
parent
8062151c30
commit
5a4320d9e3
2 changed files with 6 additions and 1 deletions
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
|||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %pluginName
|
||||
Bundle-SymbolicName: org.eclipse.launchbar.ui;singleton:=true
|
||||
Bundle-Version: 2.5.100.qualifier
|
||||
Bundle-Version: 2.5.200.qualifier
|
||||
Bundle-Activator: org.eclipse.launchbar.ui.internal.Activator
|
||||
Bundle-Vendor: %providerName
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
|
|
|
@ -49,6 +49,7 @@ import org.eclipse.swt.widgets.Control;
|
|||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
|
||||
public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILaunchBarLaunchConfigDialog {
|
||||
|
||||
|
@ -325,6 +326,10 @@ public class LaunchBarLaunchConfigDialog extends TitleAreaDialog implements ILau
|
|||
@Override
|
||||
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable)
|
||||
throws InvocationTargetException, InterruptedException {
|
||||
if (getShell() == null || !getShell().isVisible()) {
|
||||
PlatformUI.getWorkbench().getProgressService().run(fork, cancelable, runnable);
|
||||
return;
|
||||
}
|
||||
Control lastControl = getShell().getDisplay().getFocusControl();
|
||||
if (lastControl != null && lastControl.getShell() != getShell()) {
|
||||
lastControl = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue