How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.50.0
Steps to Reproduce
- Make a Gemini call where a candidate's content.parts is explicitly
None (attribute present but set to None)
- Sentry's tracing fires and calls
_extract_response_text
- hasattr check passes (attribute exists), then iterating over
None crashes
Expected Result
No exception is raised. Sentry skips recording the response text span attribute when content.parts is None.
Actual Result
TypeError: 'NoneType' object is not iterable
Traceback points to _extract_response_text in sentry_sdk/integrations/google_genai/utils.py.