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

ExternalMonitor: catch IllegalArgumentException

Sometimes, broadcast listener registering is saved but not valid

(cherry picked from commit 99328726)
parent 78660e74
No related branches found
No related tags found
No related merge requests found
......@@ -190,7 +190,9 @@ object ExternalMonitor : BroadcastReceiver(), LifecycleObserver, CoroutineScope
@OnLifecycleEvent(Lifecycle.Event.ON_STOP)
internal fun unregister() {
val ctx = VLCApplication.appContext
if (registered) ctx.unregisterReceiver(this)
if (registered) try {
ctx.unregisterReceiver(this)
} catch (iae: IllegalArgumentException) {}
registered = false
connected.value = false
devices.clear()
......
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