From 02bb7c570d526ed1f5e07da7b0c129611c97f3eb Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 5 Jun 2017 21:24:52 +0200 Subject: [PATCH] add a null check at widget updating --- .../calendar/helpers/MyWidgetMonthlyProvider.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 e28de4031..aee81df53 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/helpers/MyWidgetMonthlyProvider.kt @@ -68,8 +68,10 @@ class MyWidgetMonthlyProvider : AppWidgetProvider(), MonthlyCalendar { } private fun updateWidget() { - val thisWidget = ComponentName(mContext, MyWidgetMonthlyProvider::class.java) - AppWidgetManager.getInstance(mContext).updateAppWidget(thisWidget, mRemoteViews) + if (mRemoteViews != null) { + val thisWidget = ComponentName(mContext, MyWidgetMonthlyProvider::class.java) + AppWidgetManager.getInstance(mContext).updateAppWidget(thisWidget, mRemoteViews) + } } private fun setupIntent(action: String, id: Int) {