From 5db115ae43018a34c87f00207498f2e768e4f9e5 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 29 Aug 2018 09:35:10 -0400 Subject: [PATCH] check for null path --- src/electron/services/electronPlatformUtils.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/electron/services/electronPlatformUtils.service.ts b/src/electron/services/electronPlatformUtils.service.ts index b39046e2b1..b4c0ed84a7 100644 --- a/src/electron/services/electronPlatformUtils.service.ts +++ b/src/electron/services/electronPlatformUtils.service.ts @@ -117,10 +117,12 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService { remote.dialog.showSaveDialog(remote.getCurrentWindow(), { defaultPath: fileName, showsTagField: false, - }, (filename) => { - fs.writeFile(filename, Buffer.from(blobData), (err) => { - // error check? - }); + }, (path) => { + if (path != null) { + fs.writeFile(path, Buffer.from(blobData), (err) => { + // error check? + }); + } }); }