Skip to content

Commit cac1e4d

Browse files
committed
SentryUserInteractionWidget checks if the Elements are mounted before comparing them
1 parent 1ab55fc commit cac1e4d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#831)
1313
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.0.0...8.3.1)
1414

15+
### Fixes
16+
17+
- SentryUserInteractionWidget checks if the Elements are mounted before comparing them ([#1181](https://github.com/getsentry/sentry-dart/pull/1181))
18+
1519
## 7.0.0
1620

1721
### Features

flutter/lib/src/user_interaction/sentry_user_interaction_widget.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ class _SentryUserInteractionWidgetState
151151
);
152152

153153
final activeTransaction = _activeTransaction;
154+
final lastElement = _lastTappedWidget?.element;
154155
if (activeTransaction != null) {
155-
if (_lastTappedWidget?.element.widget == element.widget &&
156+
if (lastElement?.mounted == true &&
157+
element.mounted &&
158+
lastElement?.widget == element.widget &&
156159
_lastTappedWidget?.eventType == tappedWidget.eventType &&
157160
!activeTransaction.finished) {
158161
// ignore: invalid_use_of_internal_member

0 commit comments

Comments
 (0)