diff --git a/multicast/src/commonMain/kotlin/org/mobilenativefoundation/store/multicast5/ChannelManager.kt b/multicast/src/commonMain/kotlin/org/mobilenativefoundation/store/multicast5/ChannelManager.kt index 6c35fa005..e0bb23bb6 100644 --- a/multicast/src/commonMain/kotlin/org/mobilenativefoundation/store/multicast5/ChannelManager.kt +++ b/multicast/src/commonMain/kotlin/org/mobilenativefoundation/store/multicast5/ChannelManager.kt @@ -22,6 +22,7 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.SendChannel import kotlinx.coroutines.flow.Flow import org.mobilenativefoundation.store.multicast5.ChannelManager.Message +import kotlin.coroutines.cancellation.CancellationException internal interface ChannelManager { @@ -55,7 +56,11 @@ internal interface ChannelManager { suspend fun dispatchValue(value: Message.Dispatch.Value) { _awaitsDispatch = false - channel.send(value) + try { + channel.send(value) + } catch (e: CancellationException) { + // ignore + } } fun dispatchError(error: Throwable) {