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

View file

@ -101,7 +101,13 @@ void FontsCollectorThread(AssFile *subs, agi::fs::path const& destination, FcMod
std::unique_ptr<wxZipOutputStream> zip; std::unique_ptr<wxZipOutputStream> zip;
if (oper == CopyToZip) { if (oper == CopyToZip) {
out.reset(new wxFFileOutputStream(destination.wstring())); out.reset(new wxFFileOutputStream(destination.wstring()));
if (out->IsOk())
zip.reset(new wxZipOutputStream(*out)); 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; int64_t total_size = 0;