GP-2269: Preventing AWTError when checking Taskbar.isTaskbarSupported()

This commit is contained in:
Ryan Kurtz 2022-08-21 01:52:28 -04:00
parent db3ced7f96
commit 6845463e06
3 changed files with 8 additions and 11 deletions

View file

@ -15,6 +15,7 @@
*/
package ghidra;
import java.awt.AWTError;
import java.awt.Taskbar;
/**
@ -41,9 +42,13 @@ public class Ghidra {
// fully qualified class name (with . replaced by -). If we don't do this here, the next
// time it gets done is in a new thread, which results in the application name being set to
// "java-lang-thread".
if (!Boolean.getBoolean("java.awt.headless")) {
try {
Taskbar.isTaskbarSupported();
}
catch (AWTError e) {
// This can happen if we are running in a headless environment. We don't need to
// worry about setting the application name in this case.
}
// Forward args to GhidraLauncher, which will perform the launch
GhidraLauncher.launch(args);