From d84416b27c3f64c0f9f9b89c4d85ef79d6c3dac2 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Tue, 28 Nov 2023 01:02:05 +0900 Subject: [PATCH] fix: crash --- src/index.ts | 4 ++-- src/loader/main.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6442b0b2..3a6b0be2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -140,7 +140,7 @@ const initHook = (win: BrowserWindow) => { if (!isEqual) { const oldConfig = oldPluginConfigList[id] as PluginConfig; const config = deepmerge( - mainPlugins[id].config, + allPlugins[id].config, newPluginConfig, ) as PluginConfig; @@ -155,7 +155,7 @@ const initHook = (win: BrowserWindow) => { forceUnloadMainPlugin(id, win); } - if (mainPlugins[id].restartNeeded) { + if (mainPlugins[id]?.restartNeeded) { showNeedToRestartDialog(id); } } diff --git a/src/loader/main.ts b/src/loader/main.ts index 9eb4fe5c..18780a5c 100644 --- a/src/loader/main.ts +++ b/src/loader/main.ts @@ -79,7 +79,7 @@ export const forceLoadMainPlugin = async ( win: BrowserWindow, ): Promise => { const plugin = mainPlugins[id]; - if (!plugin.backend) return; + if (!plugin) return; return new Promise((resolve, reject) => { try {