Skip to content
Snippets Groups Projects
Commit 70706d40 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

widgets manager: Prevent NPE

(cherry picked from commit 23465078)
parent 2aefd25b
No related branches found
No related tags found
No related merge requests found
......@@ -484,7 +484,7 @@ class PlaybackService : MediaBrowserServiceCompat(), CoroutineScope, LifecycleOw
}
private fun updateHasWidget() {
val manager = AppWidgetManager.getInstance(this)
val manager = AppWidgetManager.getInstance(this) ?: return
widget = when {
manager.getAppWidgetIds(ComponentName(this, VLCAppWidgetProviderWhite::class.java)).isNotEmpty() -> 1
manager.getAppWidgetIds(ComponentName(this, VLCAppWidgetProviderBlack::class.java)).isNotEmpty() -> 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment