Skip to content

Commit 2dff075

Browse files
return correct type to FIRTransactionResult
1 parent cbcdd48 commit 2dff075

File tree

1 file changed

+4
-2
lines changed
  • firebase-database/src/iosMain/kotlin/dev/gitlive/firebase/database

1 file changed

+4
-2
lines changed

firebase-database/src/iosMain/kotlin/dev/gitlive/firebase/database/database.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import dev.gitlive.firebase.database.ChildEvent.Type.*
1313
import dev.gitlive.firebase.decode
1414
import kotlinx.coroutines.CompletableDeferred
1515
import kotlinx.coroutines.FlowPreview
16-
import kotlinx.coroutines.channels.ClosedSendChannelException
1716
import kotlinx.coroutines.channels.awaitClose
1817
import kotlinx.coroutines.coroutineScope
1918
import kotlinx.coroutines.flow.callbackFlow
@@ -164,7 +163,10 @@ actual class DatabaseReference internal constructor(
164163
val deferred = CompletableDeferred<DataSnapshot>()
165164
ios.runTransactionBlock(
166165
block = { firMutableData ->
167-
FIRTransactionResult.successWithValue(transactionUpdate(decode(strategy, firMutableData.value)))
166+
firMutableData?.value = firMutableData?.value?.let {
167+
transactionUpdate(decode(strategy, firMutableData.value))
168+
}
169+
FIRTransactionResult.successWithValue(firMutableData!!)
168170
},
169171
andCompletionBlock = { error, _, snapshot ->
170172
if (error != null) {

0 commit comments

Comments
 (0)