Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix - deal with case when check view exists returns None (#5740)

Ishaan Jaff535228159b6e
diff --git a/litellm/proxy/utils.py b/litellm/proxy/utils.py
index f0ee7ea9f7d..f8d463dd6cc 100644
--- a/litellm/proxy/utils.py
+++ b/litellm/proxy/utils.py
@@ -991,6 +991,11 @@ class PrismaClient:
"""
)
expected_total_views = len(expected_views)
+
+ # Deal with case when ret is None
+ if ret is None:
+ ret = [{"view_count": 0, "view_names": []}]
+
if ret[0]["view_count"] == expected_total_views:
verbose_proxy_logger.info("All necessary views exist!")
return