From 659559a7a456f96d4b2a98292c8f1384ac367cfe Mon Sep 17 00:00:00 2001 From: Alkacid <113257654+Alkacid@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:58:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A3=80=E6=9F=A5description?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加检查description是否为空,避免调用startswith报错 --- plugins/Generic/plugin-sync-configuration-gists.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Generic/plugin-sync-configuration-gists.js b/plugins/Generic/plugin-sync-configuration-gists.js index 13987b2..64009b7 100644 --- a/plugins/Generic/plugin-sync-configuration-gists.js +++ b/plugins/Generic/plugin-sync-configuration-gists.js @@ -157,7 +157,9 @@ const getPrefix = () => { const filterList = (list) => { const prefix = getPrefix() - return list.filter((v) => v.description.startsWith(prefix)).map((v) => ({ label: v.description, value: v.id })) + return list + .filter((v) => v.description && v.description.startsWith(prefix)) + .map((v) => ({ label: v.description, value: v.id })) } /**