Don't display an error when opening read-only formats

This commit is contained in:
Thomas Goyne 2012-10-29 06:29:16 -07:00
parent b5baacec2c
commit 6c2ccd8639
1 changed files with 6 additions and 2 deletions

View File

@ -189,8 +189,12 @@ void AssFile::SaveMemory(std::vector<char> &dst) {
}
bool AssFile::CanSave() const {
const SubtitleFormat *writer = SubtitleFormat::GetWriter(filename);
return writer && writer->CanSave(this);
try {
return SubtitleFormat::GetWriter(filename)->CanSave(this);
}
catch (...) {
return false;
}
}
void AssFile::Clear() {