From 323d43f8288ccf8cd442df2d4aaf0e11bd75f9e9 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 6 Sep 2004 07:08:23 +0000 Subject: [PATCH] fix editor crash when saving a new, empty course: don't set up fixed songs with pSong == NULL. It'd be better to allow it, and remember song entries in courses that don't exist, so they can be displayed as "missing song" in the editor, and so editing a course doesn't erase all entries that are missing; but I don't want to go into that right now. --- stepmania/src/EditCoursesMenu.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stepmania/src/EditCoursesMenu.cpp b/stepmania/src/EditCoursesMenu.cpp index 4a80b1934b..eb62dc2ef7 100644 --- a/stepmania/src/EditCoursesMenu.cpp +++ b/stepmania/src/EditCoursesMenu.cpp @@ -408,7 +408,11 @@ void EditCoursesMenu::OnRowValueChanged( Row row ) pEntry = GetSelectedEntry(); if( pEntry == NULL ) { - pCourse->m_entries.push_back( CourseEntry() ); + CourseEntry ce; + const vector &apSongs = SONGMAN->GetAllSongs(); + ASSERT( !apSongs.empty() ); + ce.pSong = apSongs[0]; + pCourse->m_entries.push_back( ce ); pEntry = GetSelectedEntry(); } // fall through