fix: handle None items in alipan list to prevent TypeError (#5765)

When the Aliyun Drive API returns an error response (e.g. UserNotAllowedAccessDrive), resp.get("items") is None, causing len() to raise TypeError. Extract items with a safe default to fix the crash and avoid a potential infinite loop.

Fix https://github.com/jxxghp/MoviePilot/issues/5664

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
DDSRem
2026-05-13 19:09:45 +08:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent 5a585839ba
commit 1af3a0ef59
+3 -2
View File
@@ -378,9 +378,10 @@ class AliPan(StorageBase, metaclass=WeakSingleton):
if not resp:
break
next_marker = resp.get("next_marker")
for item in resp.get("items", []):
current_items = resp.get("items") or []
for item in current_items:
items.append(self.__get_fileitem(item, parent=str(fileitem.path)))
if len(resp.get("items")) < 100:
if len(current_items) < 100:
break
return items