Skip to content

Commit

Permalink
fixing crashing bug with reset callback after closed (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
Attempt3035 authored Aug 24, 2024
1 parent 1d106e3 commit 7a323d5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/stop_watch_timer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,12 @@ class StopWatchTimer {
_currentSessionStartTime = 0;
_previousTotalSessionTime = 0;
_records = [];
_recordsController.add(_records);
_elapsedTime.add(_presetTime);
if (!_recordsController.isClosed) {
_recordsController.add(_records);
}
if (!_elapsedTime.isClosed) {
_elapsedTime.add(_presetTime);
}
}

void _lap() {
Expand Down

0 comments on commit 7a323d5

Please sign in to comment.