[Android] Fix crash when changing audio tabs

Nicolas Pomepuy git at videolan.org
Tue Apr 13 06:48:09 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Apr  6 11:55:01 2021 +0200| [6a5af923f47ae8a74e0323d92d72d68b8c425f47] | committer: Nicolas Pomepuy

Fix crash when changing audio tabs

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

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

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.kt b/application/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.kt
index 78d1e55a6..f99c7f11b 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/audio/BaseAudioBrowser.kt
@@ -218,7 +218,7 @@ abstract class BaseAudioBrowser<T : MedialibraryViewModel> : MediaBrowserFragmen
     override fun onTabUnselected(tab: TabLayout.Tab) {
         stopActionMode()
         needToReopenSearch = (activity as? ContentActivity)?.isSearchViewVisible() ?: false
-        lastQuery = (activity as? ContentActivity)?.getCurrentQuery() as String
+        lastQuery = (activity as? ContentActivity)?.getCurrentQuery() as? String ?: ""
     }
 
     override fun onTabReselected(tab: TabLayout.Tab) {}



More information about the Android mailing list