diff --git a/electron/src/main.js b/electron/src/main.js index f78680e08..2774ddc6d 100644 --- a/electron/src/main.js +++ b/electron/src/main.js @@ -44,7 +44,8 @@ app.on('window-all-closed', () => { ipcMain.on('print', function (event, pageSize) { mainWindow.webContents.printToPDF({"pageSize": pageSize}, function(error, data) { dialog.showSaveDialog(mainWindow, {"defaultPath": "inkstitch.pdf"}, function(filename, bookmark) { - fs.writeFileSync(filename, data, 'utf-8'); + if (typeof filename !== 'undefined') + fs.writeFileSync(filename, data, 'utf-8'); }) }) }) \ No newline at end of file