From 6c2ccd86395a5141bb1738c4d643a37eb3e328b1 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 29 Oct 2012 06:29:16 -0700 Subject: [PATCH] Don't display an error when opening read-only formats --- aegisub/src/ass_file.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 36197a131..90967bb25 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -189,8 +189,12 @@ void AssFile::SaveMemory(std::vector &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() {