Fix crash when a subtitles file is not found

This commit is contained in:
Thomas Goyne 2013-11-09 15:56:09 -08:00
parent f0ff8c6179
commit 747e34b981
1 changed files with 21 additions and 21 deletions

View File

@ -83,6 +83,7 @@ SubsController::SubsController(agi::Context *context)
}
void SubsController::Load(agi::fs::path const& filename, std::string charset) {
try {
try {
if (charset.empty())
charset = CharSetDetect::GetEncoding(filename);
@ -109,7 +110,6 @@ void SubsController::Load(agi::fs::path const& filename, std::string charset) {
const SubtitleFormat *reader = SubtitleFormat::GetReader(filename, charset);
try {
AssFile temp;
reader->ReadFile(&temp, filename, charset);