mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-02 22:55:26 +02:00
Fix NPE in launch control when no descriptors.
Also allows the enable preference to always disable. Change-Id: I991e26eb312d8bf0c9e32a4ce37119d4c38481a4
This commit is contained in:
parent
0aa31108c4
commit
6c4c3c9363
1 changed files with 15 additions and 9 deletions
|
@ -96,17 +96,23 @@ public class LaunchBarControl implements ILaunchBarListener {
|
|||
configSelector.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
|
||||
configSelector.setInput(manager);
|
||||
|
||||
// TODO remove
|
||||
boolean enabled = store.getBoolean(Activator.PREF_ENABLE_TARGETSELECTOR);
|
||||
|
||||
boolean supportsTargets = true;
|
||||
try {
|
||||
ILaunchDescriptor desc = manager.getActiveLaunchDescriptor();
|
||||
supportsTargets = desc.getType().supportsTargets();
|
||||
} catch (CoreException e) {
|
||||
Activator.log(e);
|
||||
boolean supportsTargets;
|
||||
if (!enabled) {
|
||||
supportsTargets = false;
|
||||
} else {
|
||||
try {
|
||||
ILaunchDescriptor desc = manager.getActiveLaunchDescriptor();
|
||||
if (desc != null) {
|
||||
supportsTargets = desc.getType().supportsTargets();
|
||||
} else {
|
||||
supportsTargets = true;
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
Activator.log(e);
|
||||
supportsTargets = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (supportsTargets) {
|
||||
createTargetSelector();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue