From 73cc4c07935dfd53f023c567b24d1011712c6dcf Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 12 Aug 2007 22:44:22 +0000 Subject: [PATCH] skip SONGMAN->GetSongFromDir if sDir2.empty() --- stepmania/src/SongUtil.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stepmania/src/SongUtil.cpp b/stepmania/src/SongUtil.cpp index 0532880297..79189eaf69 100644 --- a/stepmania/src/SongUtil.cpp +++ b/stepmania/src/SongUtil.cpp @@ -885,7 +885,7 @@ void SongID::FromSong( const Song *p ) Song *SongID::ToSong() const { - Song *pRet; + Song *pRet = NULL; if( !m_Cache.Get(&pRet) ) { // HACK for backwards compatibility: @@ -894,7 +894,8 @@ Song *SongID::ToSong() const if( sDir2.Left(1) != "/" ) sDir2 = "/" + sDir2; - pRet = SONGMAN->GetSongFromDir( sDir2 ); + if( !sDir2.empty() ) + pRet = SONGMAN->GetSongFromDir( sDir2 ); m_Cache.Set( pRet ); } return pRet;