Tile-based output filename may not exist, check g_stat return value

This commit is contained in:
Lovell Fuller
2016-11-06 14:31:28 +00:00
parent 9911863441
commit a7b024d4fa
2 changed files with 127 additions and 104 deletions

View File

@@ -917,8 +917,9 @@ class PipelineWorker : public Nan::AsyncWorker {
} else {
// Add file size to info
GStatBuf st;
g_stat(baton->fileOut.data(), &st);
Set(info, New("size").ToLocalChecked(), New<v8::Uint32>(static_cast<uint32_t>(st.st_size)));
if (g_stat(baton->fileOut.data(), &st) == 0) {
Set(info, New("size").ToLocalChecked(), New<v8::Uint32>(static_cast<uint32_t>(st.st_size)));
}
argv[1] = info;
}
}