FrangSierra/RxFirebase

Firestore : Crash when permission denied (null value in Rx chain)

tspoke opened this issue · 1 comments

Hi @FrangSierra,

Thanks again for your library.

I found a unwanted behavior when I get an PERMISSION_DENIED from firestore: my app crash.

When Firestore return this error, the OnCompleteListener is called, not the failure. But, the result is empty (null) and the rx chain is broken due to this null value (and my app crash).

A screenshot of the problem :
screenshot

I think a acceptable approach would be to check the null value before emitting the onSuccess(). If a null is found, call onError with a typed exception like FirestorePermissionDeniedException (or just return the original exception which is typed).

Thanks a lot!

Hello @tspoke ,

I just fix this on the last release. Thank you for the support!