1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

NPE in StopActiveCommandHandler when origin is null

Change-Id: Ic6749311328d9521d64c5d339006c0065e200117
This commit is contained in:
Alena Laskavaia 2015-08-25 09:30:27 -04:00
parent 6c7b1ba259
commit 38577c4ec9

View file

@ -50,17 +50,24 @@ public class StopActiveCommandHandler extends AbstractHandler {
final ILaunch[] activeLaunches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
if (activeLaunches != null && activeLaunches.length > 0) {
new Job(Messages.StopActiveCommandHandler_0) {
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
ILaunchConfiguration activeConfig = launchBarManager.getActiveLaunchConfiguration();
if (activeConfig == null) {
return Status.OK_STATUS;
}
for (ILaunch launch : activeLaunches) {
ILaunchConfiguration launchConfig = launch.getLaunchConfiguration();
if (launchConfig != null && launchConfig.equals(activeConfig)) {
if (activeConfig.equals(launchConfig)) {
launch.terminate();
} else if (launchConfig instanceof ILaunchConfigurationWorkingCopy) {
continue;
}
if (launchConfig instanceof ILaunchConfigurationWorkingCopy) {
// There are evil delegates that use a working copy for scratch storage
if (((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal().equals(activeConfig)) {
if (activeConfig.equals(((ILaunchConfigurationWorkingCopy) launchConfig).getOriginal())) {
launch.terminate();
continue;
}
}
}