From 869be1b32d7433a04b536e3e75974e5ac4053632 Mon Sep 17 00:00:00 2001 From: optyfr <17027109+optyfr@users.noreply.github.com> Date: Thu, 15 Aug 2024 15:16:58 +0200 Subject: [PATCH] add check to be sure that saved folder setting is an existing folder --- jrmfx/src/main/java/jrm/fx/ui/ProfilePanelController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jrmfx/src/main/java/jrm/fx/ui/ProfilePanelController.java b/jrmfx/src/main/java/jrm/fx/ui/ProfilePanelController.java index 4fa1eb7c..37950012 100644 --- a/jrmfx/src/main/java/jrm/fx/ui/ProfilePanelController.java +++ b/jrmfx/src/main/java/jrm/fx/ui/ProfilePanelController.java @@ -368,7 +368,7 @@ private void importDat(final boolean sl) final var filter2 = new ExtensionFilter(Messages.getString("MainFrame.MameExecutable"), SystemUtils.IS_OS_WINDOWS?"*mame*.exe":"*mame*"); chooser.getExtensionFilters().addAll(filter, filter2); chooser.setSelectedExtensionFilter(filter); - Optional.ofNullable(session.getUser().getSettings().getProperty("MainFrame.ChooseExeOrDatToImport", workdir.getAbsolutePath())).map(File::new).ifPresent(chooser::setInitialDirectory); + Optional.ofNullable(session.getUser().getSettings().getProperty("MainFrame.ChooseExeOrDatToImport", workdir.getAbsolutePath())).map(File::new).filter(File::isDirectory).ifPresent(chooser::setInitialDirectory); final var files = chooser.showOpenMultipleDialog(profilesList.getScene().getWindow()); importDat(files, sl); if (files != null)