Fix possible crash displaying asset preview from current file
For some reason the asset preview isn't created or loaded correctly in some instances. This could be addressed with D9974, but hard to tell since I only have a failing .blend file, no steps to recreate it from scratch. Would crash when opening an Asset Browser, selecting an object asset (that has an invalid preview stored) and opening the Asset Browser sidebar, so that the preview is visible there.
This commit is contained in:
@@ -1442,7 +1442,9 @@ static void filelist_cache_preview_runf(TaskPool *__restrict pool, void *taskdat
|
||||
if (preview->in_memory_preview) {
|
||||
if (BKE_previewimg_is_finished(preview->in_memory_preview, ICON_SIZE_PREVIEW)) {
|
||||
ImBuf *imbuf = BKE_previewimg_to_imbuf(preview->in_memory_preview, ICON_SIZE_PREVIEW);
|
||||
preview->icon_id = BKE_icon_imbuf_create(imbuf);
|
||||
if (imbuf) {
|
||||
preview->icon_id = BKE_icon_imbuf_create(imbuf);
|
||||
}
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user