1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2024-12-23 00:43:32 +01:00

Fix for last dir can be inaccessible

This commit is contained in:
Carlos Galindo 2018-01-02 15:06:53 +01:00
parent e9243520e4
commit c827f36537
Signed by: kauron
GPG key ID: 83E68706DEE119A3

View file

@ -87,7 +87,7 @@ public class Controller implements Initializable {
private void onLoadAction(ActionEvent event) { private void onLoadAction(ActionEvent event) {
FileChooser chooser = new FileChooser(); FileChooser chooser = new FileChooser();
chooser.getExtensionFilters().add(new FileChooser.ExtensionFilter("JStudy file", "*.jsdb")); 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<File> list = chooser.showOpenMultipleDialog(root.getScene().getWindow()); List<File> list = chooser.showOpenMultipleDialog(root.getScene().getWindow());
if (list == null || list.isEmpty()) return; if (list == null || list.isEmpty()) return;
AppConfig.lastDir = list.get(0).getParentFile(); AppConfig.lastDir = list.get(0).getParentFile();