From 9cd245220f423040f293bb7676d06c67a7f64bbd Mon Sep 17 00:00:00 2001 From: MyristicaFragrans <17411952+MyristicaFragrans@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:11:44 -0700 Subject: [PATCH] Fix bug when save file is cancelled, null path is passed around --- app/main-process/projectWindow.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/main-process/projectWindow.js b/app/main-process/projectWindow.js index bf364275..6eb0f445 100644 --- a/app/main-process/projectWindow.js +++ b/app/main-process/projectWindow.js @@ -158,6 +158,7 @@ ProjectWindow.prototype.zoom = function(amount) { // Try to load up an optional .settings.json file ProjectWindow.prototype.refreshProjectSettings = function(rootInkFilePath) { + if (!rootInkFilePath) return let self = this; @@ -279,6 +280,7 @@ ProjectWindow.clearRecentFiles = function() { } function addRecentFile(filePath) { + if (!filePath) return; const resolvedFilePath = path.resolve(filePath); const recentFiles = ProjectWindow.getRecentFiles(); const newRecentFiles = recentFiles.indexOf(resolvedFilePath) >= 0 ?