Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 634ad71

Browse files
TypeError: null is not an object (evaluating 'snapshot.documents') while logging off #876
1 parent ed463eb commit 634ad71

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/firebase.ios.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,6 +2247,10 @@ firebase.firestore.onDocumentSnapshot = (docRef: FIRDocumentReference, callback:
22472247

22482248
firebase.firestore.onCollectionSnapshot = (colRef: FIRCollectionReference, callback: (snapshot: QuerySnapshot) => void): () => void => {
22492249
const listener = colRef.addSnapshotListener((snapshot: FIRQuerySnapshot, error: NSError) => {
2250+
if (error || !snapshot) {
2251+
return;
2252+
}
2253+
22502254
const docSnapshots: Array<firestore.DocumentSnapshot> = [];
22512255
for (let i = 0, l = snapshot.documents.count; i < l; i++) {
22522256
const document: FIRQueryDocumentSnapshot = snapshot.documents.objectAtIndex(i);

0 commit comments

Comments
 (0)