From db349a56ef9e79039f5f69aadd5558ce75c1c896 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 18 Jan 2021 19:23:52 +0100 Subject: [PATCH] fix: no exception if token is just null --- lib/utils/firebase_controller.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/utils/firebase_controller.dart b/lib/utils/firebase_controller.dart index 16e9fd00..b5bf0677 100644 --- a/lib/utils/firebase_controller.dart +++ b/lib/utils/firebase_controller.dart @@ -34,11 +34,11 @@ abstract class FirebaseController { String token; try { token = await _firebaseMessaging.getToken(); + if (token?.isEmpty ?? true) { + throw '_firebaseMessaging.getToken() has not thrown an exception but returned no token'; + } } catch (e, s) { - token = null; Logs().w('Unable to get firebase token', e, s); - } - if (token?.isEmpty ?? true) { final storeItem = await matrix.store.getItem(SettingKeys.showNoGoogle); final configOptionMissing = storeItem == null || storeItem.isEmpty; if (configOptionMissing || (!configOptionMissing && storeItem == '1')) {