Handle empty AutoDL image lists
Controller CI / test (push) Successful in 1s

This commit is contained in:
2026-10-02 10:57:31 +08:00
parent 9bd8b7cc1e
commit 61863ae676
2 changed files with 9 additions and 1 deletions
+3 -1
View File
@@ -77,7 +77,9 @@ class AutoDLClient:
"/api/v1/dev/instance/pro/image/private/list",
{"page_index": 1, "page_size": 100},
)
return list(data.get("list", []))
# AutoDL returns JSON null instead of [] when the account has no
# private images. Treat both representations as an empty result.
return list(data.get("list") or [])
def create(self, spec: dict[str, Any]) -> str:
return str(self.request("POST", "/api/v1/dev/instance/pro/create", spec))