From 6293c0e4a484d6ab2a00971d5090192a1dbe318e Mon Sep 17 00:00:00 2001 From: leiyilu <1509167646@qq.com> Date: Tue, 21 Jun 2022 22:03:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/xiaoyao_image.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/xiaoyao_image.js b/apps/xiaoyao_image.js index 29a1353..c6ea1e0 100644 --- a/apps/xiaoyao_image.js +++ b/apps/xiaoyao_image.js @@ -69,7 +69,11 @@ export async function init(isUpdate = false) { weapon.set(val, i); } } - weaponFile = fs.readdirSync("./plugins/xiaoyao-cvs-plugin/resources/xiaoyao-plus/wuqi_tujian"); + let paths="./plugins/xiaoyao-cvs-plugin/resources/xiaoyao-plus/wuqi_tujian"; + if (!fs.existsSync(paths)) { + return true; + } + weaponFile = fs.readdirSync(paths); for (let val of weaponFile) { let name = val.replace(".png", ""); weapon.set(name, name);