Fixed crash in case that an invalid .music file is in a track directory.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5837 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2010-08-31 23:06:24 +00:00
parent c5cb36e8e7
commit 75bfa4946b

View File

@ -111,7 +111,14 @@ void MusicManager::loadMusicFromOneDir(const std::string& dir)
for(std::set<std::string>::iterator i = files.begin(); i != files.end(); ++i)
{
if(StringUtils::getExtension(*i)!="music") continue;
m_allMusic[StringUtils::getBasename(*i)] = new MusicInformation(*i);
try
{
m_allMusic[StringUtils::getBasename(*i)] = new MusicInformation(*i);
}
catch (std::exception& e)
{
continue;
}
} // for i
} // loadMusicFromOneDir