Fix T83843: Crash in Asset Browser sidebar with geometry asset selected

No icon should be created if the preview doesn't exist.
This commit is contained in:
Julian Eisel 2020-12-16 16:07:23 +01:00
parent 4463087223
commit 7ed69bd672
Notes: blender-bot 2023-07-10 10:12:37 +02:00
Referenced by issue #83843, Asset Browser: Crash when opening the right panel region with an asset of type Geometry selected
1 changed files with 3 additions and 1 deletions

View File

@ -1511,7 +1511,9 @@ static void filelist_cache_preview_runf(TaskPool *__restrict pool, void *taskdat
* in case user switch to a bigger preview size. */
ImBuf *imbuf = IMB_thumb_manage(preview->path, THB_LARGE, source);
IMB_thumb_path_unlock(preview->path);
preview->icon_id = BKE_icon_imbuf_create(imbuf);
if (imbuf) {
preview->icon_id = BKE_icon_imbuf_create(imbuf);
}
done = true;
}