[Android] Fix IllegalStateException

Nicolas Pomepuy git at videolan.org
Thu Apr 9 10:37:05 CEST 2020


vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Apr  9 07:52:18 2020 +0200| [dba0b9d96850bbf871dcab35a9e20dafbb17a61a] | committer: Nicolas Pomepuy

Fix IllegalStateException

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
index 91d566da8..a0fb97811 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.kt
@@ -300,6 +300,7 @@ class AudioBrowserFragment : BaseAudioBrowser<AudioBrowserViewModel>(), SwipeRef
     }
 
     private fun updateEmptyView() {
+        if (activity == null) return
         val emptyVisibility = getViewModel().providers[currentTab].isEmpty() && getViewModel().providers[currentTab].loading.value == false
         emptyView.visibility = if (emptyVisibility) View.VISIBLE else View.GONE
         medialibrarySettingsBtn.visibility = if (emptyVisibility) View.VISIBLE else View.GONE



More information about the Android mailing list