From 9dd4abfc49553aae8284ca9bc07936ef67a6ac9e Mon Sep 17 00:00:00 2001 From: William Schaefer Date: Tue, 13 Apr 2021 11:48:57 -0400 Subject: [PATCH] 7471 tweak startup window behavior --- .../autopsy/casemodule/StartupWindowProvider.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java index 7b3040e778..a6b020b849 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindowProvider.java @@ -144,9 +144,12 @@ public class StartupWindowProvider implements StartupWindowInterface { if (openPreviousCaseFile.exists()) { //do actual opening on another thread new Thread(() -> { + //close the startup window as we attempt to open the case + close(); String caseFilePath = ""; String unableToOpenMessage = null; try { + //avoid readFileToString having ambiguous arguments Charset encoding = null; caseFilePath = FileUtils.readFileToString(openPreviousCaseFile, encoding); if (new File(caseFilePath).exists()) { @@ -168,11 +171,10 @@ public class StartupWindowProvider implements StartupWindowInterface { final String message = unableToOpenMessage; SwingUtilities.invokeLater(() -> { MessageNotifyUtil.Message.warn(message); + //the case was not opened restore the startup window + open(); }); - } else { - close(); - } - + } }).start(); } }