Fix resultSerializer to correctly check returned file picker path (#6713)

This commit is contained in:
Charles Gagnon
2019-08-12 14:52:37 -07:00
committed by GitHub
parent b4df060362
commit 1f6164a0ca

View File

@@ -130,7 +130,7 @@ export class ResultSerializer {
}
private promptForFilepath(format: SaveFormat, resourceUri: string): Thenable<string> {
private promptForFilepath(format: SaveFormat, resourceUri: string): Thenable<string | undefined> {
let filepathPlaceHolder = prevSavePath ? path.dirname(prevSavePath) : resolveCurrentDirectory(resourceUri, this.rootPath);
if (filepathPlaceHolder) {
filepathPlaceHolder = path.join(filepathPlaceHolder, this.getResultsDefaultFilename(format));
@@ -141,8 +141,11 @@ export class ResultSerializer {
defaultUri: filepathPlaceHolder ? URI.file(filepathPlaceHolder) : undefined,
filters: this.getResultsFileExtension(format)
}).then(filePath => {
prevSavePath = filePath.fsPath;
return filePath.fsPath;
if (filePath) {
prevSavePath = filePath.fsPath;
return filePath.fsPath;
}
return undefined;
});
}