mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 07:56:52 +08:00
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:
co-authored by
Claude Sonnet 4.6
parent
5a585839ba
commit
1af3a0ef59
@@ -378,9 +378,10 @@ class AliPan(StorageBase, metaclass=WeakSingleton):
|
|||||||
if not resp:
|
if not resp:
|
||||||
break
|
break
|
||||||
next_marker = resp.get("next_marker")
|
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)))
|
items.append(self.__get_fileitem(item, parent=str(fileitem.path)))
|
||||||
if len(resp.get("items")) < 100:
|
if len(current_items) < 100:
|
||||||
break
|
break
|
||||||
return items
|
return items
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user