From 97547db85bfbbafcb2ca55cc214e292d2b9ba34f Mon Sep 17 00:00:00 2001 From: sandymcfadden Date: Tue, 4 May 2021 12:38:22 -0300 Subject: [PATCH] Check to ensure theme setting is preset before setting electron native theme (#2890) Fixes #2888 When setting the Electron nativeTheme with the theme selected in the Simplenote settings it can cause a JavaScript error if the theme setting isn't present, such as when logging out of the app. This checks to ensure the theme setting is set before updating the Electron nativeTheme setting. --- desktop/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop/app.js b/desktop/app.js index 068c739cd..904ba8b77 100644 --- a/desktop/app.js +++ b/desktop/app.js @@ -103,7 +103,9 @@ module.exports = function main() { Menu.setApplicationMenu( Menu.buildFromTemplate(createMenuTemplate(args), mainWindow) ); - nativeTheme.themeSource = settings.theme; + if ('theme' in settings) { + nativeTheme.themeSource = settings.theme; + } }); ipcMain.on('clearCookies', function () {