Skip to content
Snippets Groups Projects
Commit d70f7a79 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Fix ArrayIndexOutOfBoundsException in extractSingles

parent d0041aaf
No related branches found
No related tags found
1 merge request!7023.3 fixes
Pipeline #21797 passed with stage
in 23 minutes and 13 seconds
......@@ -28,5 +28,5 @@ class VideoGroupsProvider(context: Context, model: SortableModel) : Medialibrary
}
private fun Array<VideoGroup>.extractSingles() = map {
if (it.mediaCount() == 1) it.media(Medialibrary.SORT_DEFAULT, false, 1, 0)[0] else it
if (it.mediaCount() == 1) it.media(Medialibrary.SORT_DEFAULT, false, 1, 0).getOrNull(0) ?: it else it
}.toTypedArray()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment