From cc73423b6a4ef6df357c629585e4c70e1817532f Mon Sep 17 00:00:00 2001 From: Kyle Humphrey Date: Wed, 23 Mar 2022 17:52:06 -0500 Subject: [PATCH] fix edge case where songwheel would break if there is no song in index --- scripts/songselect/songwheel.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/songselect/songwheel.lua b/scripts/songselect/songwheel.lua index 3efcb8d..60a8e93 100644 --- a/scripts/songselect/songwheel.lua +++ b/scripts/songselect/songwheel.lua @@ -775,7 +775,6 @@ function drawScrollbar() gfx.ImageRect(fillXPos, scrollbarYPos, sw, sh, scrollBarFillImage, 1, 0); -- 1st letter of song title on scroll - local letter = string.upper(common.firstLetter(songwheel.songs[selectedIndex].title)); gfx.BeginPath() gfx.FontSize(16) gfx.LoadSkinFont('Digital-Serial-Bold.ttf') @@ -784,8 +783,10 @@ function drawScrollbar() gfx.Fill() gfx.FillColor(255,255,255) gfx.TextAlign(gfx.TEXT_ALIGN_MIDDLE + gfx.TEXT_ALIGN_CENTER) + if (songwheel.songs[selectedIndex] ~= nil) then + local letter = string.upper(common.firstLetter(songwheel.songs[selectedIndex].title)); gfx.Text(letter, fillXPos-10, scrollbarYPos + 5); - + end end function refreshIrLeaderboard(deltaTime)