diff --git a/backend/open_webui/apps/retrieval/utils.py b/backend/open_webui/apps/retrieval/utils.py index b7d746bfa..174e37495 100644 --- a/backend/open_webui/apps/retrieval/utils.py +++ b/backend/open_webui/apps/retrieval/utils.py @@ -193,7 +193,8 @@ def query_collection( k=k, query_embedding=query_embedding, ) - results.append(result.model_dump()) + if result is not None: + results.append(result.model_dump()) except Exception as e: log.exception(f"Error when querying the collection: {e}") else: