Skip to content

Commit

Permalink
improvement: check for SentryTracer type in TTID (#2497)
Browse files Browse the repository at this point in the history
* fix

* update

* update CHANGELOG
  • Loading branch information
buenaflor authored Dec 13, 2024
1 parent 7b4ce83 commit a8bff7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

### Improvements

- Check for type before casting in TTID ([#2497](https://github.com/getsentry/sentry-dart/pull/2497))

### Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ class TimeToInitialDisplayTracker {
final _endTimestamp = endTimestamp ?? await determineEndTime();
if (_endTimestamp == null) return;

final tracer = transaction as SentryTracer;
if (transaction is! SentryTracer) {
return;
}

final ttidSpan = transaction.startChild(
SentrySpanOperations.uiTimeToInitialDisplay,
description: '${tracer.name} initial display',
description: '${transaction.name} initial display',
startTimestamp: startTimestamp,
);

Expand Down

0 comments on commit a8bff7d

Please sign in to comment.