Skip to content

Commit efd9e7f

Browse files
fix(google-genai): Tolerate None candidates (#7519)
1 parent ec53096 commit efd9e7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • sentry_sdk/integrations/google_genai

sentry_sdk/integrations/google_genai/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ def extract_tool_calls(
608608

609609
# Extract from candidates, sometimes tool calls are nested under the content.parts object
610610
candidates = getattr(response, "candidates", [])
611-
if response is not None:
611+
if candidates and response is not None:
612612
for candidate in candidates:
613613
if not hasattr(candidate, "content") or not getattr(
614614
candidate.content, "parts", []

0 commit comments

Comments
 (0)