Skip to content
代码片段 群组 项目
提交 1a6a0795 编辑于 作者: Jing Teng's avatar Jing Teng 提交者: Timotej Ecimovic
浏览文件

fix NPE popup when trying to File->Open with no active Electron window

open
上级 57dd0463
No related branches found
No related tags found
无相关合并请求
......@@ -67,12 +67,12 @@ Functions:`
*/
async function execRendererApi(browserWindow, rendererApiCommand, ...theArgs) {
const info = await browserWindow.webContents.executeJavaScript(
const info = await browserWindow?.webContents.executeJavaScript(
`window.${rendApi.GLOBAL_SYMBOL_INFO}`
)
let apiFound = info.functions.filter((x) => x.id === rendererApiCommand)
if (!apiFound.length) {
let apiFound = info?.functions.filter((x) => x.id === rendererApiCommand)
if (!apiFound?.length) {
env.logBrowser(
`Unhandled renderer API function id invoked: ${rendererApiCommand}`
)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册