mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Checks directory exists before setInitialDirectory
Added a little defensive coding to prevent error: Folder parameter must be a valid folder.
This commit is contained in:
parent
2c593559db
commit
37309445b1
@ -139,7 +139,10 @@ public class GUIUtil {
|
||||
public static void importAccounts(User user, String fileName, Preferences preferences, Stage stage,
|
||||
PersistenceProtoResolver persistenceProtoResolver) {
|
||||
FileChooser fileChooser = new FileChooser();
|
||||
fileChooser.setInitialDirectory(new File(preferences.getDirectoryChooserPath()));
|
||||
File initDir = new File(preferences.getDirectoryChooserPath());
|
||||
if (initDir.isDirectory()) {
|
||||
fileChooser.setInitialDirectory(initDir);
|
||||
}
|
||||
fileChooser.setTitle(Res.get("guiUtil.accountExport.selectPath", fileName));
|
||||
File file = fileChooser.showOpenDialog(stage.getOwner());
|
||||
if (file != null) {
|
||||
@ -202,7 +205,10 @@ public class GUIUtil {
|
||||
|
||||
public static String getDirectoryFromChooser(Preferences preferences, Stage stage) {
|
||||
DirectoryChooser directoryChooser = new DirectoryChooser();
|
||||
directoryChooser.setInitialDirectory(new File(preferences.getDirectoryChooserPath()));
|
||||
File initDir = new File(preferences.getDirectoryChooserPath());
|
||||
if (initDir.isDirectory()) {
|
||||
directoryChooser.setInitialDirectory(initDir);
|
||||
}
|
||||
directoryChooser.setTitle(Res.get("guiUtil.accountExport.selectExportPath"));
|
||||
File dir = directoryChooser.showDialog(stage);
|
||||
if (dir != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user