[Android] Fix IllegalArgumentException

Nicolas Pomepuy git at videolan.org
Thu Sep 12 16:34:23 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Sep 11 08:11:51 2019 +0200| [c92b6c5bd9f9c3278eee162f6857bc99a61dca02] | committer: Geoffrey Métais

Fix IllegalArgumentException

> https://code.videolan.org/videolan/vlc-android/commit/c92b6c5bd9f9c3278eee162f6857bc99a61dca02
---

 vlc-android/src/org/videolan/vlc/ExternalMonitor.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/ExternalMonitor.kt b/vlc-android/src/org/videolan/vlc/ExternalMonitor.kt
index 58a672cb9..2019e2004 100644
--- a/vlc-android/src/org/videolan/vlc/ExternalMonitor.kt
+++ b/vlc-android/src/org/videolan/vlc/ExternalMonitor.kt
@@ -190,7 +190,7 @@ object ExternalMonitor : BroadcastReceiver(), LifecycleObserver, CoroutineScope
     @OnLifecycleEvent(Lifecycle.Event.ON_STOP)
     internal fun unregister() {
         val ctx = VLCApplication.appContext
-        ctx.unregisterReceiver(this)
+        if (registered) ctx.unregisterReceiver(this)
         registered = false
         connected.value = false
         devices.clear()



More information about the Android mailing list