Skip to content

Commit

Permalink
optimize: 判断 win 是否为空,避免异常
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Sep 30, 2024
1 parent 26c0b07 commit 33ccf67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/gui/src/bridge/api/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

// 合并用户配置
Expand Down

0 comments on commit 33ccf67

Please sign in to comment.