Archived
1
Fork 0

Quit early if cannot write to thumbnail cache

This commit is contained in:
redstrate 2021-02-05 19:50:31 -05:00
parent d97e88741b
commit 461fb98a8c

View file

@ -1125,6 +1125,10 @@ void CommonEditor::save_thumbnail_cache() {
GFXBuffer* thumbnailBuffer = engine->get_gfx()->create_buffer(nullptr, thumbnail_resolution * thumbnail_resolution * 4, false, GFXBufferUsage::Storage); GFXBuffer* thumbnailBuffer = engine->get_gfx()->create_buffer(nullptr, thumbnail_resolution * thumbnail_resolution * 4, false, GFXBufferUsage::Storage);
FILE* file = fopen("thumbnail-cache", "wb"); FILE* file = fopen("thumbnail-cache", "wb");
if(file == nullptr) {
console::error(System::Core, "Failed to write thumbnail cache!");
return;
}
int size = asset_thumbnails.size(); int size = asset_thumbnails.size();
fwrite(&size, sizeof(int), 1, file); fwrite(&size, sizeof(int), 1, file);