Skip to content

Commit 0730dfa

Browse files
authored
fix: fix collection_list empty bug (#106)
1 parent 7eae9c1 commit 0730dfa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

veadk/database/viking/viking_database.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ def collection_exists(self, collection_name: str) -> bool:
387387
logger.error(f"Error in list_collections: {result['message']}")
388388
raise ValueError(f"Error in list_collections: {result['message']}")
389389

390-
collections = result["data"]["collection_list"]
391-
if not collections:
392-
raise ValueError(f"No collections found in project {self.config.project}.")
390+
collections = result["data"].get("collection_list", [])
391+
if len(collections) == 0:
392+
return False
393393

394394
collection_list = set()
395395

0 commit comments

Comments
 (0)