Skip to content

Commit

Permalink
Fix incorrect non-null assertion
Browse files Browse the repository at this point in the history
I believe `_target` can be `null` here.
  • Loading branch information
mnordine authored Sep 22, 2024
1 parent d8549a3 commit fc1df4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/lib/src/helpers/events/streams.dart
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ class _EventStreamSubscription<T extends html.Event>

void _tryResume() {
if (_onData != null && !isPaused) {
_target!.addEventListener(_eventType, _onData, _useCapture.toJS);
_target?.addEventListener(_eventType, _onData, _useCapture.toJS);
}
}

void _unlisten() {
if (_onData != null) {
_target!.removeEventListener(_eventType, _onData, _useCapture.toJS);
_target?.removeEventListener(_eventType, _onData, _useCapture.toJS);
}
}

Expand Down

0 comments on commit fc1df4a

Please sign in to comment.