From cdc4de85ed1ccd3c7f1b85f24eb005b0b2f014e4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 20 Jan 2016 23:42:59 +0100 Subject: [PATCH] lets catch the occasional exception at unregistering the widget Bus --- .../simplemobiletools/com/MyWidgetProvider.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/musicplayer/simplemobiletools/com/MyWidgetProvider.java b/app/src/main/java/musicplayer/simplemobiletools/com/MyWidgetProvider.java index 77b0ad02..56e5235f 100644 --- a/app/src/main/java/musicplayer/simplemobiletools/com/MyWidgetProvider.java +++ b/app/src/main/java/musicplayer/simplemobiletools/com/MyWidgetProvider.java @@ -105,7 +105,11 @@ public class MyWidgetProvider extends AppWidgetProvider { @Override public void onDeleted(Context context, int[] appWidgetIds) { super.onDeleted(context, appWidgetIds); - if (bus != null) - bus.unregister(this); + if (bus != null) { + try { + bus.unregister(this); + } catch (Exception e) { + } + } } }