From 06e0f640c30383498aa68ed69c4c18e47e68b5d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80lex=20Magaz=20Gra=C3=A7a?= Date: Sat, 18 Apr 2026 18:30:50 +0200 Subject: [PATCH] Fix crash when scrolling to the bottom of the Songs tab list (from Library) This happened when scrolling by dragging the scrollbar handle. It was due to not taking into account the first item is Shuffle, which isn't in the songs list. Apply the same fix as in the Albums list. --- .../shuttle/ui/screens/library/songs/SongList.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/songs/SongList.kt b/android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/songs/SongList.kt index adb73a0d7..6a7dad157 100644 --- a/android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/songs/SongList.kt +++ b/android/app/src/main/java/com/simplecityapps/shuttle/ui/screens/library/songs/SongList.kt @@ -182,7 +182,13 @@ private fun SongList( modifier = Modifier.fillMaxSize().padding(vertical = 8.dp), state = state, getPopupText = { index -> - getFastscrollPopupText(songs[index], sortOrder) + // Offset by 1 for the shuffle item + val songIndex = index - 1 + if (songIndex in songs.indices) { + getFastscrollPopupText(songs[songIndex], sortOrder) + } else { + "" + } }, popup = getFastscrollPopup(sortOrder) )