Skip to content

Commit e4a0624

Browse files
committed
None checks
1 parent b7bbf77 commit e4a0624

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/sentry/seer/explorer/index_data.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ def get_transactions_for_project(project_id: int) -> list[Transaction]:
8282
seen_names = set()
8383
for row in result.get("data", []):
8484
name = row.get("transaction")
85+
if not name:
86+
continue
87+
8588
normalized_name = normalize_description(name)
8689
if normalized_name in seen_names:
8790
continue
@@ -438,12 +441,19 @@ def get_issues_for_transaction(transaction_name: str, project_id: int) -> Transa
438441
)
439442
continue
440443

441-
full_event: GroupEvent = eventstore.get_event_by_id(
444+
full_event: GroupEvent | None = eventstore.get_event_by_id(
442445
project_id=group.project_id,
443446
event_id=recommended_event.event_id,
444447
group_id=group.id,
445448
)
446449

450+
if not full_event:
451+
logger.warning(
452+
"No event found for issue",
453+
extra={"group_id": group.id, "transaction_name": transaction_name},
454+
)
455+
continue
456+
447457
serialized_event = serialize(full_event, user=None, serializer=EventSerializer())
448458

449459
issue_data_list.append(

0 commit comments

Comments
 (0)