fix(api): 修复任务列表解析中的空值错误

- 将 data.get('data', {}).get('tasks', []) 修改为 data.get('data', {}).get('tasks') or []
- 防止当 tasks 字段为 None 时导致的解析异常
- 确保即使返回数据中没有 tasks 字段也能正常处理
This commit is contained in:
2026-01-17 14:35:58 +08:00
parent 2bded11a03
commit d5cd0dca03

View File

@@ -81,7 +81,7 @@ class APIClientV2:
# 解析任务列表
tasks = []
for task_data in data.get('data', {}).get('tasks', []):
for task_data in data.get('data', {}).get('tasks') or []:
try:
task = Task.from_dict(task_data)
tasks.append(task)