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:
@@ -408,7 +408,11 @@ void EditCoursesMenu::OnRowValueChanged( Row row )
|
|||||||
pEntry = GetSelectedEntry();
|
pEntry = GetSelectedEntry();
|
||||||
if( pEntry == NULL )
|
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();
|
pEntry = GetSelectedEntry();
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
|
|||||||
Reference in New Issue
Block a user