Skip to content

Commit

Permalink
don't add to the sink if the taskQueue is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
agrapine committed Jan 26, 2021
1 parent a9f49f6 commit 67d2249
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/state_queue/lib/src/state_queue.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ abstract class StateQueue<T> extends ValueNotifier<T>
/// of the bloc can not be awaited properly.
@protected
void run(StateUpdater<T> updater) {
assert(!_taskQueue.isClosed);

if(_taskQueue.isClosed) {
return;
}

final entry = _UpdaterEntry(
updater,
onDone: _pendingOperations.registerPendingOperation('UpdaterEntry'),
Expand Down

0 comments on commit 67d2249

Please sign in to comment.