From fb4822d6c6d9a0e9bf76dd4d01c682b3acd5f54a Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Wed, 23 Mar 2005 03:36:30 +0000 Subject: [PATCH] fix backsp on empty string crashes --- stepmania/src/ScreenTextEntry.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 8fd48a1c0e..f196ddd9d0 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -253,6 +253,11 @@ void ScreenTextEntry::AppendToAnswer( CString s ) void ScreenTextEntry::BackspaceInAnswer() { + if( m_sAnswer.empty() ) + { + SCREENMAN->PlayInvalidSound(); + return; + } m_sAnswer.erase( m_sAnswer.end()-1 ); m_sndBackspace.Play(); UpdateAnswerText();