Prevent NPE

This commit is contained in:
Milos Kozak 2022-08-01 14:33:19 +02:00
parent b6f15456cc
commit ef0a44e276

View file

@ -256,7 +256,7 @@ class Widget : AppWidgetProvider() {
internal fun updateWidget(context: Context) {
context.sendBroadcast(Intent().also {
it.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, AppWidgetManager.getInstance(context).getAppWidgetIds(ComponentName(context, Widget::class.java)))
it.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, AppWidgetManager.getInstance(context)?.getAppWidgetIds(ComponentName(context, Widget::class.java)))
it.action = AppWidgetManager.ACTION_APPWIDGET_UPDATE
})
}