[Android] Fix NullPointerException

Nicolas Pomepuy git at videolan.org
Thu Aug 12 11:56:12 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Aug 12 10:02:20 2021 +0200| [4cbfaeb1365b08c4aa02bfe1ef751539e1bbae06] | committer: Nicolas Pomepuy

Fix NullPointerException

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

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

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/MLStorageBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/MLStorageBrowserFragment.kt
index 183624cdb..70c2470e9 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/MLStorageBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/MLStorageBrowserFragment.kt
@@ -137,7 +137,7 @@ class MLStorageBrowserFragment : BaseFragment(), IStorageFragmentDelegate by Sto
         networkViewModel = getBrowserModel(category = TYPE_NETWORK, url = null, showHiddenFiles = false)
         networkViewModel.dataset.observe(viewLifecycleOwner, { list ->
              list?.let {
-                val filtered = it.filter { item -> item is MediaWrapper && item.uri.scheme == "smb" }
+                val filtered = it.filter { item -> item is MediaWrapper && item.uri?.scheme == "smb" }
                 networkAdapter.update(filtered)
                 updateNetworkEmptyView(networkEntry.loading)
                 if (networkViewModel.loading.value == false) networkEntry.loading.state = if (list.isEmpty()) EmptyLoadingState.EMPTY else EmptyLoadingState.NONE



More information about the Android mailing list