From 39e9962e41ba76e89df83d1fec00a9e6f95b7b02 Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Sat, 26 Mar 2005 22:59:13 +0000 Subject: [PATCH] Fix: Don't crash on null validate callback --- stepmania/src/ScreenTextEntry.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index ad1786ce78..44afbee466 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -324,11 +324,14 @@ void ScreenTextEntry::End( bool bCancelled ) { CString sAnswer = WStringToCString(m_sAnswer); CString sError; - bool bValidAnswer = m_pValidate( sAnswer, sError ); - if( !bValidAnswer ) + if ( m_pValidate != NULL ) { - SCREENMAN->Prompt( SM_None, sError ); - return; // don't end this screen. + bool bValidAnswer = m_pValidate( sAnswer, sError ); + if( !bValidAnswer ) + { + SCREENMAN->Prompt( SM_None, sError ); + return; // don't end this screen. + } } if( m_pOnOK )