From e1e5c278b9ec714b836a3ab9f2b69cd5402d2514 Mon Sep 17 00:00:00 2001 From: linyuchen Date: Thu, 14 Nov 2024 14:51:01 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=E4=BF=AE=E5=A4=8D=20hook=20ipc=20?= =?UTF-8?q?=E6=97=B6=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0=20eventName=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=85=B6=E4=BB=96=E6=8F=92=E4=BB=B6=20ipc=20?= =?UTF-8?q?=E9=80=9A=E4=BF=A1=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ntqqapi/hook.ts | 2 +- src/renderer/index.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ntqqapi/hook.ts b/src/ntqqapi/hook.ts index 66fe858..177e250 100644 --- a/src/ntqqapi/hook.ts +++ b/src/ntqqapi/hook.ts @@ -46,7 +46,7 @@ export function startHook() { ipcMain.emit = new Proxy(ipcMain.emit, { apply(target, thisArg, args: [eventName: string, ...args: any]) { - if (args[2]?.eventName.startsWith('ns-LoggerApi')) { + if (args[2]?.eventName?.startsWith('ns-LoggerApi')) { return target.apply(thisArg, args) } if (logHook) { diff --git a/src/renderer/index.ts b/src/renderer/index.ts index 7adf213..fab55d1 100644 --- a/src/renderer/index.ts +++ b/src/renderer/index.ts @@ -11,6 +11,10 @@ function isEmpty(value: unknown) { } async function onSettingWindowCreated(view: Element) { + console.log(view) + if (!view){ + return + } const config = await window.llonebot.getConfig() const ob11Config = { ...config.ob11 }