mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
fix: guard casted_metadata None before 'in' check and return empty dict on None metadata
This commit is contained in:
parent
72c273590e
commit
96b4d25640
1 changed files with 2 additions and 2 deletions
|
|
@ -1546,7 +1546,7 @@ def prepare_metadata_fields(
|
|||
)
|
||||
|
||||
non_default_values["metadata"] = casted_metadata
|
||||
if metadata_provided_in_update and "logging" in casted_metadata:
|
||||
if metadata_provided_in_update and casted_metadata and "logging" in casted_metadata:
|
||||
encrypt_logging_callback_vars(non_default_values["metadata"])
|
||||
return non_default_values
|
||||
|
||||
|
|
@ -4983,7 +4983,7 @@ async def _list_key_helper(
|
|||
if return_full_object is True or (expand and "user" in expand):
|
||||
key_dict["metadata"] = redact_sensitive_logging_metadata(
|
||||
key_dict.get("metadata")
|
||||
)
|
||||
) or {}
|
||||
if use_deleted_table:
|
||||
# Use deleted key type to preserve deleted_at, deleted_by, etc.
|
||||
key_list.append(LiteLLM_DeletedVerificationToken(**key_dict))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue