From 5d67acd9f627efac60a47d11d6517bb8a22fa7dc Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Thu, 10 Mar 2005 20:53:07 +0000 Subject: [PATCH] fix AV if no #DIFFICULTIESTOHIDE --- stepmania/src/Course.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 3ee5a66eec..52595e65ee 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -392,7 +392,8 @@ void Course::Save( CString sPath, bool bSavingCache ) CString s; FOREACHS_CONST( CourseDifficulty, m_vDifficultiesToHide, cd ) s += CourseDifficultyToString( *cd ) + ','; - s.erase( s.end()-1 ); // erase last ',' + if( !s.empty() ) + s.erase( s.end()-1 ); // erase last ',' f.PutLine( "#DIFFICULTIESTOHIDE:" + s + ";" ); }