/ song wheel crash when no songs are found
This commit is contained in:
parent
0958417879
commit
2ff18307d1
|
@ -201,8 +201,7 @@ function drawBackground(deltaTime)
|
|||
|
||||
-- If the score for song exists
|
||||
local song = songwheel.songs[selectedIndex];
|
||||
local diff = song.difficulties[selectedDifficulty];
|
||||
local bestScore = diff.scores[1];
|
||||
local diff = song and song.difficulties[selectedDifficulty] or false;
|
||||
if song and diff then
|
||||
local jacketImage = getJacketImage(song);
|
||||
gfx.BeginPath()
|
||||
|
@ -334,8 +333,10 @@ end
|
|||
local scoreNumbers = load_number_image("score_num");
|
||||
function drawData() -- Draws the song data on the left panel
|
||||
local song = songwheel.songs[selectedIndex];
|
||||
local diff = song.difficulties[selectedDifficulty];
|
||||
local bestScore = diff.scores[1];
|
||||
local diff = song and song.difficulties[selectedDifficulty] or false;
|
||||
local bestScore = diff and diff.scores[1];
|
||||
|
||||
if not song then return false end
|
||||
|
||||
local jacketImage = getJacketImage(song);
|
||||
gfx.BeginPath()
|
||||
|
|
Loading…
Reference in New Issue