Quit early if cannot write to thumbnail cache
This commit is contained in:
parent
d97e88741b
commit
461fb98a8c
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||||
|
|
Reference in a new issue