diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-05-30 18:35:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-30 18:35:06 +0200 |
commit | a2cf1c3d049d0ca4de9d939550d1fb21c4d54297 (patch) | |
tree | 99e2a7ff11e9bc9164372f4db58da0ea6fac6ef3 /editor | |
parent | 62b868fd37bce1d38fdb1a158a6064cd19eed411 (diff) | |
parent | b42df97edd4b855141f10e21145d471fcc93cad0 (diff) |
Merge pull request #29319 from fire/preview_Crash
Check error code before using FileAccess to create a preview and cras…
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_resource_preview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index 2baad8c904..6cca0a0ffa 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -203,7 +203,9 @@ void EditorResourcePreview::_generate_preview(Ref<ImageTexture> &r_texture, Ref< if (has_small_texture) { ResourceSaver::save(cache_base + "_small.png", r_small_texture); } - FileAccess *f = FileAccess::open(cache_base + ".txt", FileAccess::WRITE); + Error err; + FileAccess *f = FileAccess::open(cache_base + ".txt", FileAccess::WRITE, &err); + ERR_FAIL_COND(err != OK); f->store_line(itos(thumbnail_size)); f->store_line(itos(has_small_texture)); f->store_line(itos(FileAccess::get_modified_time(p_item.path))); |