Fix #9885. Catch exceptions in track design writing

This commit is contained in:
duncanspumpkin 2019-08-17 10:59:36 +01:00
parent 1d67f86cc1
commit 748a6338a9
1 changed files with 10 additions and 2 deletions

View File

@ -33,8 +33,16 @@ T6Exporter::T6Exporter(TrackDesign* trackDesign)
bool T6Exporter::SaveTrack(const utf8* path)
{
auto fs = FileStream(path, FILE_MODE_WRITE);
return SaveTrack(&fs);
try
{
auto fs = FileStream(path, FILE_MODE_WRITE);
return SaveTrack(&fs);
}
catch (const std::exception& e)
{
log_error("Unable to save track design: %s", e.what());
return false;
}
}
bool T6Exporter::SaveTrack(IStream* stream)