Merge pull request #15374 from atom/ku-save-as-default-dir

Don't assign default path for `showSaveDialog` unless it exists
This commit is contained in:
Nathan Sobo
2017-08-18 06:58:29 -06:00
committed by GitHub
2 changed files with 6 additions and 5 deletions

View File

@@ -742,7 +742,8 @@ class Pane
return unless item?.saveAs?
saveOptions = item.getSaveDialogOptions?() ? {}
saveOptions.defaultPath ?= item.getPath()
itemPath = item.getPath()
saveOptions.defaultPath ?= itemPath if itemPath
newItemPath = @applicationDelegate.showSaveDialog(saveOptions)
if newItemPath
promisify -> item.saveAs(newItemPath)