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

Bug 335099 - [tests] NPE at the end of the JUnit tests when running headless

This commit is contained in:
Marc Khouzam 2011-01-23 03:09:28 +00:00
parent b5992da2dc
commit ec4d115af3

View file

@ -146,7 +146,10 @@ public class TracingConsoleManager implements ILaunchesListener2, IPropertyChang
} }
private TracingConsole getConsole(ILaunch launch) { private TracingConsole getConsole(ILaunch launch) {
IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); ConsolePlugin plugin = ConsolePlugin.getDefault();
if (plugin != null) {
// I've seen the plugin be null when running headless JUnit tests
IConsoleManager manager = plugin.getConsoleManager();
IConsole[] consoles = manager.getConsoles(); IConsole[] consoles = manager.getConsoles();
for (IConsole console : consoles) { for (IConsole console : consoles) {
if (console instanceof TracingConsole) { if (console instanceof TracingConsole) {
@ -156,6 +159,7 @@ public class TracingConsoleManager implements ILaunchesListener2, IPropertyChang
} }
} }
} }
}
return null; return null;
} }
} }