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:
parent
b5992da2dc
commit
ec4d115af3
1 changed files with 11 additions and 7 deletions
|
@ -146,13 +146,17 @@ 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();
|
||||||
IConsole[] consoles = manager.getConsoles();
|
if (plugin != null) {
|
||||||
for (IConsole console : consoles) {
|
// I've seen the plugin be null when running headless JUnit tests
|
||||||
if (console instanceof TracingConsole) {
|
IConsoleManager manager = plugin.getConsoleManager();
|
||||||
TracingConsole tracingConsole = (TracingConsole)console;
|
IConsole[] consoles = manager.getConsoles();
|
||||||
if (tracingConsole.getLaunch().equals(launch)) {
|
for (IConsole console : consoles) {
|
||||||
return tracingConsole;
|
if (console instanceof TracingConsole) {
|
||||||
|
TracingConsole tracingConsole = (TracingConsole)console;
|
||||||
|
if (tracingConsole.getLaunch().equals(launch)) {
|
||||||
|
return tracingConsole;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue