Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/sentry/seer/explorer/index_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,18 @@

serialized_event = serialize(full_event, user=None, serializer=EventSerializer())

group_metadata = group.data.get("metadata", {})

Check warning on line 508 in src/sentry/seer/explorer/index_data.py

View check run for this annotation

@sentry/warden / warden: sentry-backend-bugs

AttributeError when group.data is None

The code calls `group.data.get("metadata", {})` but the Group model's `data` field is defined as `LegacyTextJSONField(null=True)` (line 669 of group.py), meaning it can be None. When `group.data` is None, this line will raise `AttributeError: 'NoneType' object has no attribute 'get'`. This matches the pattern from SENTRY-3Z3P (NoneType item assignment) where code assumes a value is a dict when it can be None.
issue_data_list.append(
IssueDetails(
id=group.id,
title=group.title,
short_id=group.qualified_short_id,
culprit=group.culprit,
transaction=full_event.transaction,
events=[serialized_event],
project=group.project_id,
filename=group_metadata.get("filename"),
function=group_metadata.get("function"),
)
)

Expand Down
4 changes: 4 additions & 0 deletions src/sentry/seer/sentry_data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,15 @@ class TraceProfiles(BaseModel):
class IssueDetails(BaseModel):
id: int
title: str
short_id: str | None = None
culprit: str | None
transaction: str | None
events: list[dict[str, Any]]
metadata: dict[str, Any] = {}
message: str = ""
project: int | None = None
filename: str | None = None
function: str | None = None


class TransactionIssues(BaseModel):
Expand Down
Loading