未验证 提交 bd8a44c4 编写于 作者: S Skylot

fix(gui): correct handle of selected file in save dialog

上级 21e94d8d
......@@ -51,7 +51,15 @@ public class FileDialog {
return Collections.emptyList();
}
currentDir = fileChooser.getCurrentDirectory().toPath();
return FileUtils.toPaths(fileChooser.getSelectedFiles());
File[] selectedFiles = fileChooser.getSelectedFiles();
if (selectedFiles.length != 0) {
return FileUtils.toPaths(selectedFiles);
}
File chosenFile = fileChooser.getSelectedFile();
if (chosenFile != null) {
return Collections.singletonList(chosenFile.toPath());
}
return Collections.emptyList();
}
public Path getCurrentDir() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册