From 610679f962418a23ad17f68d0e7b5d0f2c1654b4 Mon Sep 17 00:00:00 2001 From: yan Date: Thu, 29 Jan 2026 17:20:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(tools):=20=E8=A7=A3=E5=86=B3=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E5=8A=9F=E8=83=BD=E4=B8=AD=E7=9A=84=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为 localeCompare 方法调用添加可选链操作符 - 防止当 a_key 为 null 或 undefined 时引发错误 - 确保排序逻辑在所有情况下都能正常执行 --- repo/js/FullyAutoAndSemiAutoTools/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repo/js/FullyAutoAndSemiAutoTools/main.js b/repo/js/FullyAutoAndSemiAutoTools/main.js index b741bf4a3..52675a100 100644 --- a/repo/js/FullyAutoAndSemiAutoTools/main.js +++ b/repo/js/FullyAutoAndSemiAutoTools/main.js @@ -890,7 +890,7 @@ async function initRun(config_run) { const orderA = orderMap.get(a_key) ?? 0; // 没在 JSON 中的排到最后 const orderB = orderMap.get(b_key) ?? 0; if (orderA === orderB) { - return a_key.localeCompare(b_key); + return a_key?.localeCompare(b_key); } return orderB - orderA; // 修改为倒序数字比较 })