From c827f3653759b792ef40e976bd30a12799d11016 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Tue, 2 Jan 2018 15:06:53 +0100 Subject: [PATCH] Fix for last dir can be inaccessible --- src/main/java/es/kauron/jstudy/controller/Controller.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/es/kauron/jstudy/controller/Controller.java b/src/main/java/es/kauron/jstudy/controller/Controller.java index dcc43bb..e53ac28 100644 --- a/src/main/java/es/kauron/jstudy/controller/Controller.java +++ b/src/main/java/es/kauron/jstudy/controller/Controller.java @@ -87,7 +87,7 @@ public class Controller implements Initializable { private void onLoadAction(ActionEvent event) { FileChooser chooser = new FileChooser(); chooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("JStudy file", "*.jsdb")); - if (AppConfig.lastDir != null) chooser.setInitialDirectory(AppConfig.lastDir); + if (AppConfig.lastDir != null && AppConfig.lastDir.exists()) chooser.setInitialDirectory(AppConfig.lastDir); List list = chooser.showOpenMultipleDialog(root.getScene().getWindow()); if (list == null || list.isEmpty()) return; AppConfig.lastDir = list.get(0).getParentFile();