From 49bc73748513790592ff301bc370c76ec505ea29 Mon Sep 17 00:00:00 2001 From: Rick van Lieshout Date: Mon, 12 Feb 2024 22:37:03 +0100 Subject: [PATCH] Made sure settingsWindow exists before operating on it. fixes #344 --- CHANGELOG.md | 1 + src/scripts/settings.ts | 4 ++++ 2 files changed, 5 insertions(+) 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