[Android] Fix NullPointerException

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


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Aug 12 09:52:10 2021 +0200| [9c3b7d385972d89cda69132fdc2e3873afdcd718] | committer: Nicolas Pomepuy

Fix NullPointerException

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

 .../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 dbd4d640e..bf8ce4950 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() == false) {
+        if (it?.uri?.scheme?.isSchemeFile() == false) {
             videoGroup.isNetwork = true
             return at forEach
         }



More information about the Android mailing list