From c9a342f516157a910378c26ad003e1fe6cf5af61 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 6 Jul 2017 21:45:20 +0200 Subject: [PATCH] add a try/catch block around updating the app widget --- .../calendar/helpers/MyWidgetMonthlyProvider.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt index 1c7642ed6..4a35172a5 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt @@ -77,7 +77,10 @@ class MyWidgetMonthlyProvider : AppWidgetProvider(), MonthlyCalendar { private fun updateWidget() { val thisWidget = ComponentName(mContext, MyWidgetMonthlyProvider::class.java) - AppWidgetManager.getInstance(mContext).updateAppWidget(thisWidget, mRemoteViews) + try { + AppWidgetManager.getInstance(mContext).updateAppWidget(thisWidget, mRemoteViews) + } catch (ignored: Exception) { + } } private fun setupIntent(action: String, id: Int) {