Skip to content

Commit 9139b1f

Browse files
committed
fix: cancelling file>new on escape key caused new file creation to not work again
1 parent 7ba37a3 commit 9139b1f

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/document/DocumentCommandHandlers.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -759,10 +759,13 @@ define(function (require, exports, module) {
759759
// of validating file name, creating the new file and selecting.
760760
function createWithSuggestedName(suggestedName) {
761761
return ProjectManager.createNewItem(baseDirEntry, suggestedName, false, isFolder)
762-
.done(function (file) {
763-
DocumentManager.getDocumentForPath(file.fullPath)
762+
.done(function (fileOrStatus) {
763+
if(!(typeof fileOrStatus === 'object' && fileOrStatus.fullPath)){
764+
return;
765+
}
766+
DocumentManager.getDocumentForPath(fileOrStatus.fullPath)
764767
.done(doc =>{
765-
NewFileContentManager.getInitialContentForFile(file.fullPath).then(content =>{
768+
NewFileContentManager.getInitialContentForFile(fileOrStatus.fullPath).then(content =>{
766769
doc.setText(content);
767770
});
768771
})

0 commit comments

Comments
 (0)