[Bf-blender-cvs] [03a83b4eb5b] master: Fix T89262: Crash in regular FileBrowser ID listing of 'asset' .blend files.

Bastien Montagne noreply at git.blender.org
Fri Jun 18 15:49:58 CEST 2021


Commit: 03a83b4eb5bc87dd30625d35022b6bc5e4edd8fd
Author: Bastien Montagne
Date:   Fri Jun 18 15:45:58 2021 +0200
Branches: master
https://developer.blender.org/rB03a83b4eb5bc87dd30625d35022b6bc5e4edd8fd

Fix T89262: Crash in regular FileBrowser ID listing of 'asset' .blend files.

`ED_fileselect_get_asset_params` would only return actual data pointer
when file browser is in ASSET mode.

Calling that whole section only makes sense if filebrowser is in asset
mode anyway.

Regression introduced in rBf6c5af3d4753 I think.

@Severin committing this fix now as this is a fairly critical bug for
the studio, feel free to revert and do proper fix if this one is not the
best solution.

===================================================================

M	source/blender/editors/space_file/file_draw.c

===================================================================

diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 17d029f7541..5e09692b041 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -174,7 +174,8 @@ static void file_draw_icon(const SpaceFile *sfile,
     if ((id = filelist_file_get_id(file))) {
       UI_but_drag_set_id(but, id);
     }
-    else if (file->typeflag & FILE_TYPE_ASSET) {
+    else if (sfile->browse_mode == FILE_BROWSE_MODE_ASSETS &&
+             (file->typeflag & FILE_TYPE_ASSET) != 0) {
       ImBuf *preview_image = filelist_file_getimage(file);
       char blend_path[FILE_MAX_LIBEXTRA];
       if (BLO_library_path_explode(path, blend_path, NULL, NULL)) {



More information about the Bf-blender-cvs mailing list