diff --git a/core/changelog.txt b/core/changelog.txt index 3abc2513e..2803965e0 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -50,6 +50,7 @@ Please visit http://aegisub.net to download latest version - Added forums and bugtracker to Help menu. (AMZ) - Fixed Fonts Collector behavior with font shortcuts. (AMZ) - Better error reporting when loading Automation scripts (jfs) +- Attempting to load a file which does not exist no longer unloads previous subtitles. (AMZ) = 1.09 beta - 2006.01.16 =========================== diff --git a/core/frame_main.cpp b/core/frame_main.cpp index 7859714c5..050a12ab0 100644 --- a/core/frame_main.cpp +++ b/core/frame_main.cpp @@ -485,6 +485,13 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) { // Load try { + // File exists? + if (isFile) { + wxFileName fileCheck(filename); + if (!fileCheck.FileExists()) throw _T("File does not exist."); + } + + // Proceed into loading SubsBox->Clear(); AssFile::StackReset(); if (isFile) { @@ -501,6 +508,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) { } catch (AutomationError &err) { wxMessageBox(wxString(_T("Automation exception: ")) + err.message, _T("Error"), wxOK | wxICON_ERROR, NULL); + return; } catch (...) { wxMessageBox(_T("Unknown error"), _T("Error"), wxOK | wxICON_ERROR, NULL);