Fix crash when listing assets repeatedly in node search menus

When doing partial reloads of asset libraries (only reload assets from
the current file, e.g. after undo re-allocated ID pointers), we'd end up
with assets that don't have their asset data read correctly. It would
execute a branch that didn't set the asset library object necessary to
create and store asset representations.

Steps to reproduce were:
* Open .blend file with geometry node assets in there
* In a geometry node editor, press Shift+A to open the add menu
* Cancel
* Move a node
* Undo
* Press Shift+A again
This commit is contained in:
Julian Eisel 2023-01-18 18:17:02 +01:00
parent 8707cab70b
commit e4e91bf830
1 changed files with 2 additions and 1 deletions

View File

@ -3724,7 +3724,8 @@ static void filelist_readjob_load_asset_library_data(FileListReadJob *job_params
return;
}
if (tmp_filelist->asset_library != nullptr) {
/* Asset library already loaded. */
/* Asset library itself is already loaded. Load assets into this. */
job_params->load_asset_library = tmp_filelist->asset_library;
return;
}