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

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() {