From 018fffbe77414e2d6b80dc50d5f3d2d5bbf71169 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 11 Mar 2021 13:02:47 +0100 Subject: Fix failing assert when loading file with untraceable custom asset library When loading a file with an asset browser open, and it showed a custom asset library that can't be found currently (e.g. because the file is from somebody else), the `BLI_assert(0)` in `rna_FileAssetSelectParams_asset_library_get()` would fail. There was code to handle this case already, but unlike I thought it didn't run right after file read. Now it does. --- source/blender/editors/space_file/space_file.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/editors/space_file') diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 83bb8abf5d8..039ab3d6907 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -193,6 +193,8 @@ static void file_init(wmWindowManager *UNUSED(wm), ScrArea *area) if (sfile->runtime == NULL) { sfile->runtime = MEM_callocN(sizeof(*sfile->runtime), __func__); } + /* Validate the params right after file read. */ + fileselect_refresh_params(sfile); } static void file_exit(wmWindowManager *wm, ScrArea *area) -- cgit v1.2.3