fix: minor bugs and route errors

This commit is contained in:
Siddhant Rai
2025-05-27 13:50:13 +05:30
parent e2f6c04406
commit b7a6bad7cd
4 changed files with 17 additions and 5 deletions

View File

@@ -1500,7 +1500,10 @@ class PinnedAgents(Resource):
"description": agent.get("description", ""),
"source": (
str(db.dereference(agent["source"])["_id"])
if "source" in agent and isinstance(agent["source"], DBRef)
if "source" in agent
and agent["source"]
and isinstance(agent["source"], DBRef)
and db.dereference(agent["source"]) is not None
else ""
),
"chunks": agent.get("chunks", ""),