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.
This commit is contained in:
Bastien Montagne 2021-06-18 15:45:58 +02:00
parent ea4309925f
commit 03a83b4eb5
Notes: blender-bot 2023-02-13 18:21:47 +01:00
Referenced by issue #89262, Linking from a complex .blend file crash
1 changed files with 2 additions and 1 deletions

View File

@ -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)) {