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,7 +146,10 @@ public class TracingConsoleManager implements ILaunchesListener2, IPropertyChang
|
|||
}
|
||||
|
||||
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();
|
||||
for (IConsole console : consoles) {
|
||||
if (console instanceof TracingConsole) {
|
||||
|
@ -156,6 +159,7 @@ public class TracingConsoleManager implements ILaunchesListener2, IPropertyChang
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue