diff --git a/src/main/app.ts b/src/main/app.ts index a14053ed..dd60d302 100644 --- a/src/main/app.ts +++ b/src/main/app.ts @@ -610,6 +610,10 @@ if (!gotTheLock) { // fix focus issue after dialog show on Windows. webContents.on('frame-created', (_, { frame }) => { + if (!frame) { + return + } + frame.on('dom-ready', () => { frame.executeJavaScript(`if ('ctx' in window && ctx?.env?.isWindows) { window._FIX_ELECTRON_DIALOG_FOCUS ??= function () {