From 21aa78791d10fc95bbd442a2f4254244087c3e26 Mon Sep 17 00:00:00 2001 From: Andrii <124053072+levice1@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:04:17 +0200 Subject: [PATCH] Fix ConcurrentModificationError in channel_impl.dart Fix error : [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: type 'ConcurrentModificationError' is not a subtype of type 'Exception' --- lib/src/client/impl/channel_impl.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/client/impl/channel_impl.dart b/lib/src/client/impl/channel_impl.dart index bdfe944..6532467 100644 --- a/lib/src/client/impl/channel_impl.dart +++ b/lib/src/client/impl/channel_impl.dart @@ -701,7 +701,8 @@ class _ChannelImpl implements Channel { } // Multi Ack/Nack; messages up to seqNo - for (var pendingSeqNo in _pendingDeliveries.keys) { + var pdkeys = _pendingDeliveries.keys.toList(); + for (var pendingSeqNo in pdkeys) { if (pendingSeqNo > seqNo) { // only interested in keys up to pendingSeqNo break;