From 4d0dbc6019e9c1abf1e644612c49ba38d5070016 Mon Sep 17 00:00:00 2001 From: godakid Date: Sun, 8 Sep 2024 13:02:02 +0800 Subject: [PATCH] fix: parsed yaml null --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 59dc5c4..4d9493c 100644 --- a/index.ts +++ b/index.ts @@ -107,13 +107,13 @@ const logger = new Logger({ logger.error("Manifest need main field!"); } const main = await import( path.resolve(path.dirname(path.resolve(resolvedPluginPath, file)), plugin.main)); - const enabled = parsedConfig.plugins?.[plugin.name]?.enabled ?? true; + const enabled = parsedConfig?.plugins?.[plugin.name]?.enabled ?? true; if (!enabled) continue; if (typeof main.default === "function") { plugins.push({ name: plugin.name, execute: main.default, - option: parsedConfig.plugins?.[plugin.name] ?? {} + option: parsedConfig?.plugins?.[plugin.name] ?? {} }); } }