From cb65313c833e2e68f1597fce6bef679460fe7c47 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 4 May 2006 07:09:08 +0000 Subject: [PATCH] fix bogus assert fires for autogen courses --- stepmania/src/Course.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index ba84283125..e08536597b 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -890,14 +890,16 @@ bool Course::Matches( RString sGroup, RString sCourse ) const return false; RString sFile = m_sPath; - sFile.Replace("\\","/"); - vector bits; - split( sFile, "/", bits ); - ASSERT(bits.size() >= 2); /* should always have at least two parts */ - const RString &sLastBit = bits[bits.size()-1]; + if( !sFile.empty() ) + { + sFile.Replace("\\","/"); + vector bits; + split( sFile, "/", bits ); + const RString &sLastBit = bits[bits.size()-1]; + if( sCourse.EqualsNoCase(sLastBit) ) + return true; + } - if( sCourse.EqualsNoCase(sLastBit) ) - return true; if( sCourse.EqualsNoCase(this->GetTranslitFullTitle()) ) return true;