fix(authentication): stream on null account

This commit is contained in:
Hugo Pointcheval 2022-12-20 19:14:42 -05:00
parent 8837066d73
commit 222b650bd2
Signed by: hugo
GPG Key ID: 3AAC487E131E00BC

View File

@ -101,9 +101,12 @@ class AuthenticationFirebaseDataSourceImpl
@override
Stream<Account?> streamAccount() =>
_firebaseAuth.userChanges().map<Account?>((user) {
if (user.isNull) {
return null;
}
try {
return AccountModelFirebase.fromFirebaseUser(user);
} on FirebaseAuthException {
} on Exception {
return null;
}
});