fix(task): 修复后端在零用户情况下index缺失引发的故障

This commit is contained in:
DLmaster361
2025-09-17 00:13:05 +08:00
parent cd1d114cac
commit 4dff160b82
2 changed files with 15 additions and 3 deletions

View File

@@ -604,7 +604,11 @@ class GeneralManager:
if self.check_result != "Success!":
return self.check_result
if self.mode == "自动代理" and self.user_list[self.index]["status"] == "运行":
if (
self.mode == "自动代理"
and hasattr(self, "index")
and self.user_list[self.index]["status"] == "运行"
):
self.general_result = "用户手动中止任务"