Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: second-instance additionalData may be null #9352

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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