From 1f8229bf45adad79cb6b60eceff8064cfb6ae2ad Mon Sep 17 00:00:00 2001 From: Michel Date: Mon, 23 Dec 2024 17:33:23 +0100 Subject: [PATCH] fix: wraps installing extensions in a try catch --- src/main.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index af716a232..dfcaf2eeb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -182,14 +182,20 @@ const main = async () => { console.log ("main: Install extensions ...") - const installExtension = require ("electron-devtools-installer") - const installedExtensions = await installExtension.default ([ - installExtension.REACT_DEVELOPER_TOOLS, - installExtension.REDUX_DEVTOOLS, - ]) + try { + const installExtension = require ("electron-devtools-installer") + + const installedExtensions = await installExtension.default ([ + installExtension.REACT_DEVELOPER_TOOLS, + installExtension.REDUX_DEVTOOLS, + ]) - console.log (`main: Installed extensions: ${installedExtensions}`) + console.log (`main: Installed extensions: ${installedExtensions}`) + } + catch (error) { + console.error ("main: Installing extensions failed! Skipping extensions...") + } console.log ("main: Create Window ...")