From 9a36627e676ba04112f36cf9a7296f564c636062 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 20 Apr 2018 10:51:00 +0200 Subject: [PATCH] catch run time exception when starting service from event receiver --- .../java/eu/siacs/conversations/services/EventReceiver.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/EventReceiver.java b/src/main/java/eu/siacs/conversations/services/EventReceiver.java index 0806ee9d7..b82338681 100644 --- a/src/main/java/eu/siacs/conversations/services/EventReceiver.java +++ b/src/main/java/eu/siacs/conversations/services/EventReceiver.java @@ -24,7 +24,11 @@ public class EventReceiver extends BroadcastReceiver { } final String action = intent.getAction(); if (action.equals("ui") || hasEnabledAccounts(context)) { - context.startService(mIntentForService); + try { + context.startService(mIntentForService); + } catch (RuntimeException e) { + Log.d(Config.LOGTAG,"EventReceiver was unable to start service"); + } } else { Log.d(Config.LOGTAG,"EventReceiver ignored action "+mIntentForService.getAction()); }