From d5cd0dca03697d5d557ff7eb9a3a5d41feaed74b Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sat, 17 Jan 2026 14:35:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(api):=20=E4=BF=AE=E5=A4=8D=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=88=97=E8=A1=A8=E8=A7=A3=E6=9E=90=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E5=80=BC=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 data.get('data', {}).get('tasks', []) 修改为 data.get('data', {}).get('tasks') or [] - 防止当 tasks 字段为 None 时导致的解析异常 - 确保即使返回数据中没有 tasks 字段也能正常处理 --- services/api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/api_client.py b/services/api_client.py index 7888240..014274f 100644 --- a/services/api_client.py +++ b/services/api_client.py @@ -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)