[Android] Fix NoSuchElementException
Nicolas Pomepuy
git at videolan.org
Tue Dec 15 11:16:51 CET 2020
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Dec 15 08:46:23 2020 +0100| [dfab24298d6706c13e10bc68878837e38edabad4] | committer: Nicolas Pomepuy
Fix NoSuchElementException
> https://code.videolan.org/videolan/vlc-android/commit/dfab24298d6706c13e10bc68878837e38edabad4
---
.../vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
index 22e270afb..052894e11 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.kt
@@ -337,7 +337,7 @@ class VideoGridFragment : MediaBrowserFragment<VideosViewModel>(), SwipeRefreshL
}
private fun checkFolderToParent(count: Int) = if (count == 1)
- (multiSelectHelper.getSelection().first() as? MediaWrapper)?.let {
+ (multiSelectHelper.getSelection().firstOrNull() as? MediaWrapper)?.let {
if (it.type != MediaWrapper.TYPE_VIDEO) false
it.uri.retrieveParent() != null
} ?: false else false
More information about the Android
mailing list