From a59a432ff66d78e5018661295eaca1c814353305 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Thu, 17 Aug 2006 20:31:16 +0000 Subject: [PATCH] Possible fix for nil value. --- stepmania/Themes/default/Scripts/Utilities.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stepmania/Themes/default/Scripts/Utilities.lua b/stepmania/Themes/default/Scripts/Utilities.lua index e8c1570a27..dc226cba24 100644 --- a/stepmania/Themes/default/Scripts/Utilities.lua +++ b/stepmania/Themes/default/Scripts/Utilities.lua @@ -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