From 2b6bc1e30e7c97fc46efaef03f390ff8f5b1651f Mon Sep 17 00:00:00 2001 From: zxy Date: Tue, 27 May 2025 16:33:11 +0800 Subject: [PATCH] fix: Reference issue when position list type is optional. --- api/core/entities/provider_configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/core/entities/provider_configuration.py b/api/core/entities/provider_configuration.py index 66d8d0f414..7cafcee3c5 100644 --- a/api/core/entities/provider_configuration.py +++ b/api/core/entities/provider_configuration.py @@ -810,7 +810,7 @@ class ProviderConfiguration(BaseModel): def get_sort_key(model: ModelWithProviderEntity): # Get the position list for the current model type - positions = model_type_positions.get(model.model_type.value, []) + positions = model_type_positions.get(model.model_type.value, []) or [] # If the model name is in the position list, use its index for sorting # Otherwise use a large value (list length) to place undefined models at the end