1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 334940: NPE in GdbPlugin.shutdownActiveLaunches() during simple junit tests

This commit is contained in:
John Cortell 2011-01-20 20:00:59 +00:00
parent ed248b232f
commit c31bfa24ec

View file

@ -91,7 +91,14 @@ public class GdbPlugin extends Plugin {
* is shut down will result in exceptions.
*/
private void shutdownActiveLaunches() {
for (ILaunch launch : DebugPlugin.getDefault().getLaunchManager().getLaunches()) {
DebugPlugin debugPlugin = DebugPlugin.getDefault();
if (debugPlugin == null) {
// Simple junit tests don't cause the platform debug plugins to load
return;
}
for (ILaunch launch : debugPlugin.getLaunchManager().getLaunches()) {
if (launch instanceof GdbLaunch && ((GdbLaunch)launch).getSession().isActive()) {
final GdbLaunch gdbLaunch = (GdbLaunch)launch;