aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/standardPush/java/de/pixart/messenger/services/PushManagementService.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/standardPush/java/de/pixart/messenger/services/PushManagementService.java b/src/standardPush/java/de/pixart/messenger/services/PushManagementService.java
index 5660b5f84..a7054cf2f 100644
--- a/src/standardPush/java/de/pixart/messenger/services/PushManagementService.java
+++ b/src/standardPush/java/de/pixart/messenger/services/PushManagementService.java
@@ -146,7 +146,14 @@ public class PushManagementService {
}
private void retrieveFcmInstanceToken(final OnGcmInstanceTokenRetrieved instanceTokenRetrieved) {
- FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(task -> {
+ final FirebaseInstanceId firebaseInstanceId;
+ try {
+ firebaseInstanceId = FirebaseInstanceId.getInstance();
+ } catch (IllegalStateException e) {
+ Log.d(Config.LOGTAG, "unable to get firebase instance token ", e);
+ return;
+ }
+ firebaseInstanceId.getInstanceId().addOnCompleteListener(task -> {
if (!task.isSuccessful()) {
Log.d(Config.LOGTAG, "unable to get Firebase instance token", task.getException());
}