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 }