From 6de6d054acc2c8cf371562339c354767fb1efb28 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 17 Jul 2019 21:03:56 +0200 Subject: [PATCH] catch fcm library bugs --- .../conversations/services/PushManagementService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java b/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java index 2a3d1a648..1fc8e58fe 100644 --- a/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java +++ b/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java @@ -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()); }