From 33ccf67fdbe868446104b7e1d3680f4f42d3198f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=89=AF?= <841369634@qq.com> Date: Tue, 1 Oct 2024 01:04:57 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E5=88=A4=E6=96=AD=20win=20?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gui/src/bridge/api/backend.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/gui/src/bridge/api/backend.js b/packages/gui/src/bridge/api/backend.js index 97e1a45..d1d3ab2 100644 --- a/packages/gui/src/bridge/api/backend.js +++ b/packages/gui/src/bridge/api/backend.js @@ -184,14 +184,14 @@ export default { // 注册从core里来的事件,并转发给view DevSidecar.api.event.register('status', (event) => { log.info('bridge on status, event:', event) - win.webContents.send('status', { ...event }) + if (win) win.webContents.send('status', { ...event }) }) DevSidecar.api.event.register('error', (event) => { log.error('bridge on error, event:', event) - win.webContents.send('error.core', event) + if (win) win.webContents.send('error.core', event) }) DevSidecar.api.event.register('speed', (event) => { - win.webContents.send('speed', event) + if (win) win.webContents.send('speed', event) }) // 合并用户配置