From a4ac12fda3b859f31c88f58a6ba4360fdafed21e Mon Sep 17 00:00:00 2001
From: Sandy McFadden <sandy.mcfadden@automattic.com>
Date: Tue, 4 May 2021 07:27:36 -0300
Subject: [PATCH] Check to ensure theme setting is preset before setting
 electron native theme

---
 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 () {