Skip to content

Commit

Permalink
fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
darinf committed Feb 13, 2024
1 parent a21611c commit 47741b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Sources/FirebaseFirestore/DocumentReference+Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ extension DocumentReference {
getDocument(completion: { snapshot, error in
if let error {
continuation.resume(throwing: error)
} else {
continuation.resume(returning: snapshot ?? .init())
}
continuation.resume(returning: snapshot ?? .init())
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion Sources/FirebaseFirestore/Query+Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ extension Query {
getDocuments() { snapshot, error in
if let error {
continuation.resume(throwing: error)
} else {
continuation.resume(returning: snapshot ?? .init())
}
continuation.resume(returning: snapshot ?? .init())
}
}
}
Expand Down

0 comments on commit 47741b7

Please sign in to comment.