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.
This commit is contained in:
Glenn Maynard
2004-09-06 07:08:23 +00:00
parent 189018ac04
commit 323d43f828
+5 -1
View File
@@ -408,7 +408,11 @@ void EditCoursesMenu::OnRowValueChanged( Row row )
pEntry = GetSelectedEntry();
if( pEntry == NULL )
{
pCourse->m_entries.push_back( CourseEntry() );
CourseEntry ce;
const vector<Song*> &apSongs = SONGMAN->GetAllSongs();
ASSERT( !apSongs.empty() );
ce.pSong = apSongs[0];
pCourse->m_entries.push_back( ce );
pEntry = GetSelectedEntry();
}
// fall through