mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
The add_file method throws an exception where there is no file with a given name.
Catch it and leave NULL, so the silent return can be used.
This commit is contained in:
@@ -136,7 +136,13 @@ const char * CMediaHandler::extract (std::string srcName, int &size)
|
||||
|
||||
void CSndHandler::add_file(std::string fname)
|
||||
{
|
||||
boost::iostreams::mapped_file_source *mfile = CMediaHandler::add_file(fname);
|
||||
boost::iostreams::mapped_file_source *mfile = NULL;
|
||||
try
|
||||
{
|
||||
mfile = CMediaHandler::add_file(fname);
|
||||
}
|
||||
catch(...)
|
||||
{}
|
||||
if (!mfile)
|
||||
/* File doesn't exist. Silently skip it.*/
|
||||
return;
|
||||
|
Reference in New Issue
Block a user