From 1e7852ed1f81462333a7628d1f0a93e453014dd7 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 24 Jun 2006 07:46:17 +0000 Subject: [PATCH] Don't crash if we're not editing a course entry. --- stepmania/src/ScreenEdit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stepmania/src/ScreenEdit.cpp b/stepmania/src/ScreenEdit.cpp index fa20924306..5174bc5afe 100644 --- a/stepmania/src/ScreenEdit.cpp +++ b/stepmania/src/ScreenEdit.cpp @@ -1699,6 +1699,8 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) case EDIT_BUTTON_OPEN_COURSE_ATTACK_MENU: { Course *pCourse = GAMESTATE->m_pCurCourse; + if( pCourse == NULL ) + break; CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex]; float fStartTime = m_pSong->GetElapsedTimeFromBeat( GAMESTATE->m_fSongBeat ); int iAttack = FindAttackAtTime( ce.attacks, fStartTime ); @@ -1730,6 +1732,8 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB ) float fStart, fEnd; PlayerOptions po; const Course *pCourse = GAMESTATE->m_pCurCourse; + if( pCourse == NULL ) + break; const CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex]; if( m_NoteFieldEdit.m_iBeginMarker == -1 )