GP-0 fix test issue for GhidraGo

This commit is contained in:
ghidraffe 2025-03-31 11:34:05 +00:00
parent c4fefb5924
commit 3f61c478b3

View file

@ -49,8 +49,8 @@ public class GhidraGo implements GhidraLaunchable {
*/ */
@Override @Override
public void launch(GhidraApplicationLayout layout, String[] args) throws Exception { public void launch(GhidraApplicationLayout layout, String[] args) throws Exception {
ApplicationConfiguration configuration = null;
try { try {
ApplicationConfiguration configuration = null;
if (!Application.isInitialized()) { if (!Application.isInitialized()) {
System.setProperty(ApplicationProperties.APPLICATION_NAME_PROPERTY, "GhidraGo"); System.setProperty(ApplicationProperties.APPLICATION_NAME_PROPERTY, "GhidraGo");
configuration = new DockingApplicationConfiguration(); configuration = new DockingApplicationConfiguration();
@ -92,7 +92,12 @@ public class GhidraGo implements GhidraLaunchable {
catch (Exception e) { catch (Exception e) {
logOrShowError("GhidraGo Exception", "An unexpected exception occurred in GhidraGo", e); logOrShowError("GhidraGo Exception", "An unexpected exception occurred in GhidraGo", e);
} }
System.exit(-1); // if configuration is null, probably running inside a test
if (configuration != null) {
// calling System.exit explicitly is necessary, otherwise the Loading... screen
// persists instead of closing when complete.
System.exit(-1);
}
} }
private void logOrShowError(String errorTitle, String errorMessage, Exception e) { private void logOrShowError(String errorTitle, String errorMessage, Exception e) {