Skip to content

Commit f507bf8

Browse files
authored
Fix AttributeError: NoneType object has no attribute 'get' (#14609)
1 parent 93524cf commit f507bf8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

litellm/proxy/hooks/parallel_request_limiter_v3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,8 @@ async def async_log_failure_event(self, kwargs, response_obj, start_time, end_ti
832832
litellm_parent_otel_span: Union[Span, None] = (
833833
_get_parent_otel_span_from_kwargs(kwargs)
834834
)
835-
user_api_key = kwargs["litellm_params"]["metadata"].get("user_api_key")
835+
litellm_metadata = kwargs["litellm_params"]["metadata"]
836+
user_api_key = litellm_metadata.get("user_api_key") if litellm_metadata else None
836837
pipeline_operations: List[RedisPipelineIncrementOperation] = []
837838

838839
if user_api_key:

0 commit comments

Comments
 (0)