Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix: guard against None candidate in search_by_id (#198)

Ethon31c09052d60a
diff --git a/openviking/storage/vectordb/collection/local_collection.py b/openviking/storage/vectordb/collection/local_collection.py
index eb8561613..39ab4b6cb 100644
--- a/openviking/storage/vectordb/collection/local_collection.py
+++ b/openviking/storage/vectordb/collection/local_collection.py
@@ -340,7 +340,7 @@ class LocalCollection(ICollection):
pk = self.meta.primary_key
label = str_to_uint64(str(id)) if pk != AUTO_ID_KEY else int(id)
cands_list: List[CandidateData] = self.store_mgr.fetch_cands_data([label])
- if not cands_list:
+ if not cands_list or cands_list[0] is None:
return SearchResult()
cands = cands_list[0]
sparse_vector = (