Add missing error checking for opening the output zip file in the fonts collector

This commit is contained in:
Thomas Goyne 2014-04-19 20:04:02 -07:00
parent 3ed99b5cb2
commit 1677e700b2
1 changed files with 7 additions and 1 deletions

View File

@ -101,7 +101,13 @@ void FontsCollectorThread(AssFile *subs, agi::fs::path const& destination, FcMod
std::unique_ptr<wxZipOutputStream> zip;
if (oper == CopyToZip) {
out.reset(new wxFFileOutputStream(destination.wstring()));
zip.reset(new wxZipOutputStream(*out));
if (out->IsOk())
zip.reset(new wxZipOutputStream(*out));
if (!out->IsOk() || !zip || !zip->IsOk()) {
AppendText(wxString::Format(_("* Failed to open %s.\n"), destination.wstring()), 2);
collector->AddPendingEvent(wxThreadEvent(EVT_COLLECTION_DONE));
return;
}
}
int64_t total_size = 0;