[Android] Fix IllegalStateException when PlaylistFragment is not added

Nicolas Pomepuy git at videolan.org
Thu May 19 14:05:37 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu May 19 11:38:48 2022 +0200| [73872324a181f71f4a78e98c9397a5aa65f0dab8] | committer: Nicolas Pomepuy

Fix IllegalStateException when PlaylistFragment is not added

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

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

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt
index e9f27f03f..47c7370e2 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/PlaylistFragment.kt
@@ -120,6 +120,7 @@ class PlaylistFragment : BaseAudioBrowser<PlaylistsViewModel>(), SwipeRefreshLay
     }
 
     private fun updateEmptyView() {
+        if (!isAdded) return
         swipeRefreshLayout.visibility = if (Medialibrary.getInstance().isInitiated) View.VISIBLE else View.GONE
         binding.emptyLoading.emptyText = viewModel.filterQuery?.let {  getString(R.string.empty_search, it) } ?: getString(R.string.nomedia)
         binding.emptyLoading.state =



More information about the Android mailing list