[Android] Fix crash on null media location

Nicolas Pomepuy git at videolan.org
Thu Feb 10 10:58:10 UTC 2022


vlc-android | branch: 3.4.x | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Feb  7 09:18:03 2022 +0100| [28817ac8e8091d8eb7639caf097dabafeba063b5] | committer: Nicolas Pomepuy

Fix crash on null media location


(cherry picked from commit 0e9a0c8ad339b93da2e4aafbe7e73385ec377a0c)

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

 application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 5495371ee..fab705ee8 100644
--- a/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/application/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -969,7 +969,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
                     }
                     Log.w(TAG, "Invalid location $location")
 
-                    service.showToast(if (Uri.parse(location).scheme == "missing") service.getString(R.string.missing_location) else service.getString(R.string.invalid_location, location
+                    service.showToast(if (location != null && Uri.parse(location).scheme == "missing") service.getString(R.string.missing_location) else service.getString(R.string.invalid_location, location
                             ?: ""), Toast.LENGTH_SHORT, true)
                     if (currentIndex != nextIndex) next() else stop()
                 }



More information about the Android mailing list