From 2bc11654621eaa3b6bff6a14822e58b6b3c5e6ce Mon Sep 17 00:00:00 2001 From: Gijs van Veen Date: Wed, 21 Oct 2020 13:15:14 +0200 Subject: [PATCH] Additional catch --- .../src/commonMain/kotlin/dev/gitlive/firebase/firebase.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/firebase-app/src/commonMain/kotlin/dev/gitlive/firebase/firebase.kt b/firebase-app/src/commonMain/kotlin/dev/gitlive/firebase/firebase.kt index 6e3a1544b..7f44c8f0f 100644 --- a/firebase-app/src/commonMain/kotlin/dev/gitlive/firebase/firebase.kt +++ b/firebase-app/src/commonMain/kotlin/dev/gitlive/firebase/firebase.kt @@ -6,6 +6,7 @@ @file:JvmName("CommonKt") package dev.gitlive.firebase +import kotlinx.coroutines.CancellationException import kotlinx.coroutines.channels.ClosedSendChannelException import kotlinx.coroutines.channels.SendChannel import kotlin.jvm.JvmMultifileClass @@ -67,4 +68,6 @@ inline fun SendChannel.offerOrNull(element: E): Boolean? = try { offer(element) } catch (e : ClosedSendChannelException) { null +} catch (e : CancellationException) { + null }