From d1c602ead92e61d9be6fbc476441327b8be49494 Mon Sep 17 00:00:00 2001 From: Shashank Jarmale Date: Tue, 26 May 2026 15:28:33 -0700 Subject: [PATCH] Fix undefined variable in `StreamGroupSerializerSnuba` feature flag check --- src/sentry/api/serializers/models/group_stream.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sentry/api/serializers/models/group_stream.py b/src/sentry/api/serializers/models/group_stream.py index befe4a8cf2ef41..11381c7168984b 100644 --- a/src/sentry/api/serializers/models/group_stream.py +++ b/src/sentry/api/serializers/models/group_stream.py @@ -490,8 +490,10 @@ def get_attrs( ) attrs[item]["sentryAppIssues"] = sentry_app_issues - if self._expand("latestEventHasAttachments") and features.has( - "organizations:event-attachments", item.project.organization + if ( + self._expand("latestEventHasAttachments") + and item_list + and features.has("organizations:event-attachments", item_list[0].project.organization) ): for item in item_list: latest_event = item.get_latest_event()