diff --git a/stepmania/src/CourseUtil.cpp b/stepmania/src/CourseUtil.cpp index 7bbbc338e4..1562aa420a 100644 --- a/stepmania/src/CourseUtil.cpp +++ b/stepmania/src/CourseUtil.cpp @@ -200,12 +200,21 @@ void CourseID::FromCourse( const Course *p ) Course *CourseID::ToCourse() const { - Course* pCourse = NULL; - pCourse = SONGMAN->GetCourseFromPath( sPath ); - if( pCourse ) - return pCourse; - pCourse = SONGMAN->GetCourseFromName( sFullTitle ); - return pCourse; + if( !sPath.empty() ) + { + Course *pCourse = SONGMAN->GetCourseFromPath( sPath ); + if( pCourse ) + return pCourse; + } + + if( !sFullTitle.empty() ) + { + Course *pCourse = SONGMAN->GetCourseFromName( sFullTitle ); + if( pCourse ) + return pCourse; + } + + return NULL; } XNode* CourseID::CreateNode() const diff --git a/stepmania/src/SongManager.cpp b/stepmania/src/SongManager.cpp index 2abeda011a..dd7c141554 100644 --- a/stepmania/src/SongManager.cpp +++ b/stepmania/src/SongManager.cpp @@ -968,6 +968,9 @@ Song* SongManager::GetSongFromDir( CString sDir ) Course* SongManager::GetCourseFromPath( CString sPath ) { + if( sPath == "" ) + return NULL; + for( unsigned int i=0; im_sPath) == 0 ) return m_pCourses[i]; @@ -977,6 +980,9 @@ Course* SongManager::GetCourseFromPath( CString sPath ) Course* SongManager::GetCourseFromName( CString sName ) { + if( sName == "" ) + return NULL; + for( unsigned int i=0; iGetFullDisplayTitle()) == 0 ) return m_pCourses[i];