[Android] Fix NullPointerException

Nicolas Pomepuy git at videolan.org
Thu Jul 15 11:23:53 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Jul 13 10:58:00 2021 +0200| [da940139dfca5aa5c82d0cd73a822128586437d3] | committer: Nicolas Pomepuy

Fix NullPointerException

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

 .../src/org/videolan/vlc/providers/medialibrary/VideoGroupsProvider.kt  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/providers/medialibrary/VideoGroupsProvider.kt b/application/vlc-android/src/org/videolan/vlc/providers/medialibrary/VideoGroupsProvider.kt
index be3ec73e6..dbd4d640e 100644
--- a/application/vlc-android/src/org/videolan/vlc/providers/medialibrary/VideoGroupsProvider.kt
+++ b/application/vlc-android/src/org/videolan/vlc/providers/medialibrary/VideoGroupsProvider.kt
@@ -58,7 +58,7 @@ private fun Array<VideoGroup>.sanitizeGroups() = map { videoGroup ->
  */
 private fun checkIsNetwork(videoGroup: VideoGroup) {
     videoGroup.media(Medialibrary.SORT_DEFAULT, false, true, videoGroup.mediaCount(), 0).forEach {
-        if (!it.uri.scheme.isSchemeFile()) {
+        if (it.uri?.scheme?.isSchemeFile() == false) {
             videoGroup.isNetwork = true
             return at forEach
         }



More information about the Android mailing list