Don't display an error when opening read-only formats
This commit is contained in:
parent
b5baacec2c
commit
6c2ccd8639
1 changed files with 6 additions and 2 deletions
|
@ -189,8 +189,12 @@ void AssFile::SaveMemory(std::vector<char> &dst) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AssFile::CanSave() const {
|
bool AssFile::CanSave() const {
|
||||||
const SubtitleFormat *writer = SubtitleFormat::GetWriter(filename);
|
try {
|
||||||
return writer && writer->CanSave(this);
|
return SubtitleFormat::GetWriter(filename)->CanSave(this);
|
||||||
|
}
|
||||||
|
catch (...) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssFile::Clear() {
|
void AssFile::Clear() {
|
||||||
|
|
Loading…
Reference in a new issue