mirror of
https://github.com/babalae/bettergi-scripts-list.git
synced 2026-03-26 05:09:52 +08:00
fix(AutoPlan): 修复副本配置解析中的数组越界问题
- 添加数组长度检查以防止访问超出边界的索引 - 为sundaySelectedValue设置默认值避免未定义错误 - 在解析域选择值前验证数组索引范围 - 保持原有逻辑功能的同时增强代码健壮性
This commit is contained in:
@@ -241,7 +241,9 @@ async function loadMode(Load, autoOrderSet, runConfig) {
|
||||
index++
|
||||
let domainRoundNum = arr[index]; // 解析副本轮数
|
||||
index++
|
||||
let sundaySelectedValue = arr[index]; // 解析周日|限时选择的值
|
||||
let sundaySelectedValue="1"
|
||||
if (index<arr.length)
|
||||
sundaySelectedValue = arr[index]; // 解析周日|限时选择的值
|
||||
|
||||
// 检查秘境名称是否有效
|
||||
if (!config.domainNames.has(domainName)) {
|
||||
@@ -251,8 +253,10 @@ async function loadMode(Load, autoOrderSet, runConfig) {
|
||||
if (!domainNameTemp) {
|
||||
throw new Error(`${domainName} 输入错误`);
|
||||
}
|
||||
const domainSelectedValue = parseInt(config.domainOrderMap.get(domainName) + "");
|
||||
sundaySelectedValue = domainSelectedValue
|
||||
if (index<arr.length){
|
||||
const domainSelectedValue = parseInt(config.domainOrderMap.get(domainName) + "");
|
||||
sundaySelectedValue = domainSelectedValue
|
||||
}
|
||||
domainName = domainNameTemp
|
||||
} else {
|
||||
throw new Error(`${domainName} 输入错误`);
|
||||
|
||||
Reference in New Issue
Block a user