Possible fix for nil value.

This commit is contained in:
Steve Checkoway
2006-08-17 20:31:16 +00:00
parent 886f368be2
commit a59a432ff6
@@ -98,11 +98,12 @@ function GetRandomSongBackground()
end end
function GetSongBackground() function GetSongBackground()
local Path = GAMESTATE:GetCurrentSong():GetBackgroundPath() local song = GAMESTATE:GetCurrentSong()
if not Path then if song then
return THEME:GetPathG("Common","fallback background") local path = song:GetBackgroundPath()
if path then return path end
end end
return Path return THEME:GetPathG("Common","fallback background")
end end
-- (c) 2005 Glenn Maynard, Chris Danford -- (c) 2005 Glenn Maynard, Chris Danford