Skip to content

Commit b7787d9

Browse files
handle null JSON
1 parent 9d2157e commit b7787d9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

sentry_sdk/integrations/starlette.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,8 @@ def _get_cached_request_body_attribute(
498498
if content_length and not request_body_within_bounds(client, content_length):
499499
return OVER_SIZE_LIMIT_SUBSTITUTE
500500

501-
json_body = getattr(request, "_json", None)
502-
if json_body is not None:
503-
return json.dumps(json_body)
501+
if hasattr(request, "_json"):
502+
return json.dumps(request._json)
504503

505504
formdata_body = getattr(request, "_form", None)
506505
if formdata_body is None:

0 commit comments

Comments
 (0)