From 222b650bd28e5f8b518822b81bc1d76bf4af2b09 Mon Sep 17 00:00:00 2001 From: Hugo Pointcheval Date: Tue, 20 Dec 2022 19:14:42 -0500 Subject: [PATCH] fix(authentication): stream on null account --- .../remote/authentication_firebase_data_source_impl.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_firebase_data_source_impl.dart b/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_firebase_data_source_impl.dart index 8a4ce432..a0344195 100644 --- a/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_firebase_data_source_impl.dart +++ b/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_firebase_data_source_impl.dart @@ -101,9 +101,12 @@ class AuthenticationFirebaseDataSourceImpl @override Stream streamAccount() => _firebaseAuth.userChanges().map((user) { + if (user.isNull) { + return null; + } try { return AccountModelFirebase.fromFirebaseUser(user); - } on FirebaseAuthException { + } on Exception { return null; } });