diff --git a/CHANGELOG.md b/CHANGELOG.md index 3faf838..9fdb26f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed chromium mediaSession instance showing up. fixes #338 #198 - Set a new icon, should fix #302 +- Made sure settingsWindow exists before operating on it. fixes #344 ## [5.8.0] diff --git a/src/scripts/settings.ts b/src/scripts/settings.ts index ce2303b..49e1996 100644 --- a/src/scripts/settings.ts +++ b/src/scripts/settings.ts @@ -138,6 +138,10 @@ export const createSettingsWindow = function () { }; export const showSettingsWindow = function (tab = "general") { + if (!settingsWindow) { + console.log("Settings window is not initialized. Attempting to create it."); + createSettingsWindow(); + } settingsWindow.webContents.send("goToTab", tab); // refresh data just before showing the window