catch fcm library bugs

This commit is contained in:
Daniel Gultsch 2019-07-17 21:03:56 +02:00
parent d9f39df9c8
commit 6de6d054ac
1 changed files with 7 additions and 1 deletions

View File

@ -151,7 +151,13 @@ public class PushManagementService {
if (!task.isSuccessful()) {
Log.d(Config.LOGTAG, "unable to get Firebase instance token", task.getException());
}
final InstanceIdResult result = task.getResult();
final InstanceIdResult result;
try {
result = task.getResult();
} catch (Exception e) {
Log.d(Config.LOGTAG, "unable to get Firebase instance token due to bug in library ", e);
return;
}
if (result != null) {
instanceTokenRetrieved.onGcmInstanceTokenRetrieved(result.getToken());
}