mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-13 03:55:22 +02:00
Check for null when getting launch config provider.
Change-Id: I60a8dae467885dea5685515b40a658f3328b3ec3
This commit is contained in:
parent
e39d6946cf
commit
2b940d6fea
1 changed files with 14 additions and 7 deletions
|
@ -315,13 +315,15 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene
|
||||||
return null;
|
return null;
|
||||||
for (LaunchConfigProviderInfo providerInfo : configProviders.get(getDescriptorTypeId(descriptor.getType()))) {
|
for (LaunchConfigProviderInfo providerInfo : configProviders.get(getDescriptorTypeId(descriptor.getType()))) {
|
||||||
if (providerInfo.enabled(descriptor) && providerInfo.enabled(target)) {
|
if (providerInfo.enabled(descriptor) && providerInfo.enabled(target)) {
|
||||||
ILaunchConfigurationType type = providerInfo.getProvider().getLaunchConfigurationType(descriptor,
|
ILaunchConfigurationProvider provider = providerInfo.getProvider();
|
||||||
target);
|
if (provider != null && provider.supports(descriptor, target)) {
|
||||||
|
ILaunchConfigurationType type = provider.getLaunchConfigurationType(descriptor, target);
|
||||||
if (type != null) {
|
if (type != null) {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,7 +422,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene
|
||||||
ILaunchDescriptor descriptor = getLaunchDescriptor(config, target);
|
ILaunchDescriptor descriptor = getLaunchDescriptor(config, target);
|
||||||
if (descriptor == null)
|
if (descriptor == null)
|
||||||
return; // not found
|
return; // not found
|
||||||
// we do not call setActiveLaunchTarget because it will cause mode/target switch and cause flickering
|
// we do not call setActiveLaunchTarget because it will cause
|
||||||
|
// mode/target switch and cause flickering
|
||||||
boolean changeDesc = activeLaunchDesc != descriptor;
|
boolean changeDesc = activeLaunchDesc != descriptor;
|
||||||
boolean changeTarget = target != null && activeLaunchTarget != target;
|
boolean changeTarget = target != null && activeLaunchTarget != target;
|
||||||
if (changeDesc) {
|
if (changeDesc) {
|
||||||
|
@ -755,7 +758,8 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene
|
||||||
|
|
||||||
private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) {
|
private ILaunchTarget getDefaultLaunchTarget(ILaunchDescriptor descriptor) {
|
||||||
List<ILaunchTarget> targets = getLaunchTargets(descriptor);
|
List<ILaunchTarget> targets = getLaunchTargets(descriptor);
|
||||||
// chances are that better target is most recently added, rather then the oldest
|
// chances are that better target is most recently added, rather then
|
||||||
|
// the oldest
|
||||||
return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(targets.size() - 1);
|
return targets.isEmpty() ? ILaunchTarget.NULL_TARGET : targets.get(targets.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -932,7 +936,10 @@ public class LaunchBarManager implements ILaunchBarManager, ILaunchTargetListene
|
||||||
if (launchDescriptorMatches(activeLaunchDesc, configuration, target)) {
|
if (launchDescriptorMatches(activeLaunchDesc, configuration, target)) {
|
||||||
return activeLaunchDesc;
|
return activeLaunchDesc;
|
||||||
}
|
}
|
||||||
for (ILaunchDescriptor desc : getLaunchDescriptors()) { // this should be in MRU, most used first
|
for (ILaunchDescriptor desc : getLaunchDescriptors()) { // this should
|
||||||
|
// be in MRU,
|
||||||
|
// most used
|
||||||
|
// first
|
||||||
if (launchDescriptorMatches(desc, configuration, target)) {
|
if (launchDescriptorMatches(desc, configuration, target)) {
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue