Test filterPath for a null before preserving the setting. If user

cancels the FileDialog, it is not always set. #60
This commit is contained in:
Rob Greene 2021-12-12 15:53:33 -06:00
parent febe3d9f75
commit bc931fdaa0
1 changed files with 3 additions and 1 deletions

View File

@ -1498,7 +1498,9 @@ public class DiskExplorerTab {
fileDialog.setFileName(Host.getFileName(disks[0].getFilename()));
fileDialog.setText(textBundle.get("SaveDiskImageAsPrompt")); //$NON-NLS-1$
String fullpath = fileDialog.open();
userPreferences.setSaveDirectory(fileDialog.getFilterPath());
if (fileDialog.getFilterPath() != null) {
userPreferences.setSaveDirectory(fileDialog.getFilterPath());
}
if (fullpath == null) {
return; // user pressed cancel
}