From b1b6d82c33c114ff3ca7d02fe174e9a8a44c4503 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Sat, 17 Oct 2026 17:17:24 +0800 Subject: [PATCH] fix(types): guard nullable AliPan streams --- app/modules/filemanager/storages/alipan.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/modules/filemanager/storages/alipan.py b/app/modules/filemanager/storages/alipan.py index 98fc18ad1..7cdc4c316 100644 --- a/app/modules/filemanager/storages/alipan.py +++ b/app/modules/filemanager/storages/alipan.py @@ -14,9 +14,9 @@ from app.runtime.log import logger from app.runtime.settings import get_runtime_setting from app.runtime.stop import runtime_stop_state from app.schemas.exception import StorageQueryError +from app.schemas.file import FileItem as _SchemaFileItem from app.schemas.file import StorageUsage as _SchemaStorageUsage from app.schemas.types import StorageSchema -from app.schemas.workflow import FileItem as _SchemaFileItem lock = threading.Lock() @@ -791,6 +791,8 @@ class AliPan(StorageBase, metaclass=WeakSingleton): request_utils = RequestUtils(headers=headers) with request_utils.get_stream(download_url, raise_exception=True) as r: + if r is None: + return None r.raise_for_status() downloaded_size = 0 with open(local_path, "wb") as f: