fix backsp on empty string crashes

This commit is contained in:
Chris Danford
2005-03-23 03:36:30 +00:00
parent 42619c8666
commit fb4822d6c6
+5
View File
@@ -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();