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
function GetSongBackground()
local Path = GAMESTATE:GetCurrentSong():GetBackgroundPath()
if not Path then
return THEME:GetPathG("Common","fallback background")
local song = GAMESTATE:GetCurrentSong()
if song then
local path = song:GetBackgroundPath()
if path then return path end
end
return Path
return THEME:GetPathG("Common","fallback background")
end
-- (c) 2005 Glenn Maynard, Chris Danford