File tree 1 file changed +4
-8
lines changed
firebase-firestore/ktx/src/main/kotlin/com/google/firebase/firestore/ktx
1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -186,14 +186,12 @@ class FirebaseFirestoreKtxRegistrar : ComponentRegistrar {
186
186
fun DocumentReference.toFlow (
187
187
metadataChanges : MetadataChanges = MetadataChanges .EXCLUDE ,
188
188
bufferCapacity : Int? = Channel .CONFLATED
189
- ): Flow <DocumentSnapshot ? > {
189
+ ): Flow <DocumentSnapshot > {
190
190
val flow = callbackFlow {
191
191
val registration = addSnapshotListener(metadataChanges) { snapshot, exception ->
192
192
if (exception != null ) {
193
193
cancel(message = " Error getting DocumentReference snapshot" , cause = exception)
194
- }
195
-
196
- if (snapshot != null ) {
194
+ } else if (snapshot != null ) {
197
195
trySend(snapshot)
198
196
}
199
197
}
@@ -220,14 +218,12 @@ fun DocumentReference.toFlow(
220
218
fun Query.toFlow (
221
219
metadataChanges : MetadataChanges = MetadataChanges .EXCLUDE ,
222
220
bufferCapacity : Int? = Channel .CONFLATED
223
- ): Flow <QuerySnapshot ? > {
221
+ ): Flow <QuerySnapshot > {
224
222
val flow = callbackFlow {
225
223
val registration = addSnapshotListener(metadataChanges) { snapshot, exception ->
226
224
if (exception != null ) {
227
225
cancel(message = " Error getting Query snapshot" , cause = exception)
228
- }
229
-
230
- if (snapshot != null ) {
226
+ } else if (snapshot != null ) {
231
227
trySend(snapshot)
232
228
}
233
229
}
You can’t perform that action at this time.
0 commit comments