Skip to content

Commit 910c679

Browse files
committed
fix(integrations): Use explicit None checks instead of or {} pattern
1 parent 0355c63 commit 910c679

File tree

1 file changed

+4
-2
lines changed
  • sentry_sdk/integrations/google_genai

1 file changed

+4
-2
lines changed

sentry_sdk/integrations/google_genai/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,14 +383,16 @@ def _extract_tool_message_from_part(part: "Any") -> "Optional[dict[str, Any]]":
383383
if isinstance(function_response, dict):
384384
tool_call_id = function_response.get("id")
385385
tool_name = function_response.get("name")
386-
response_dict = function_response.get("response") or {}
386+
response_dict = function_response.get("response", {})
387387
# Prefer "output" key if present, otherwise use entire response
388388
output = response_dict.get("output", response_dict)
389389
else:
390390
# FunctionResponse object
391391
tool_call_id = getattr(function_response, "id", None)
392392
tool_name = getattr(function_response, "name", None)
393-
response_obj = getattr(function_response, "response", None) or {}
393+
response_obj = getattr(function_response, "response", None)
394+
if response_obj is None:
395+
response_obj = {}
394396
if isinstance(response_obj, dict):
395397
output = response_obj.get("output", response_obj)
396398
else:

0 commit comments

Comments
 (0)