Skip to content

Commit

Permalink
fix: second-instance additionalData may be null
Browse files Browse the repository at this point in the history
  • Loading branch information
starpit committed Apr 20, 2023
1 parent 2ca0ff9 commit e508a85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/main/spawn-electron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e508a85

Please sign in to comment.