From e508a859f25081ecbf2d4645c312d22423646285 Mon Sep 17 00:00:00 2001 From: Nick Mitchell Date: Thu, 20 Apr 2023 09:44:03 -0400 Subject: [PATCH] fix: second-instance additionalData may be null --- packages/core/src/main/spawn-electron.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/main/spawn-electron.ts b/packages/core/src/main/spawn-electron.ts index 227ee906e5a..2165972410b 100644 --- a/packages/core/src/main/spawn-electron.ts +++ b/packages/core/src/main/spawn-electron.ts @@ -734,14 +734,14 @@ export async function initElectron( // Someone tried to run a second instance, open a new window // to handle it - const env = !additionalData.env ? process.env : JSON.parse(additionalData.env) + const env = !additionalData || !additionalData.env ? process.env : JSON.parse(additionalData.env) const { argv, subwindowPlease, subwindowPrefs: defaultSubwindowPrefs } = getCommand(commandLine, cwd, env, async () => import('electron')) - const mySubwindowPrefs = additionalData.subwindowPrefs || defaultSubwindowPrefs + const mySubwindowPrefs = (additionalData && additionalData.subwindowPrefs) || defaultSubwindowPrefs if (!mySubwindowPrefs.width && widthFromCaller) { mySubwindowPrefs.width = widthFromCaller }