Fix: crash when opening node add menu

Differential Revision: https://developer.blender.org/D16995
This commit is contained in:
2023-01-13 17:25:20 +01:00
parent d4e638baac
commit 761e6b1b78

View File

@@ -108,6 +108,9 @@ static AssetItemTree build_catalog_tree(const bContext &C, const bNodeTree *node
const asset_system::AssetCatalog *catalog = all_library->catalog_service->find_catalog(
meta_data.catalog_id);
if (catalog == nullptr) {
return true;
}
assets_per_path.add(catalog->path, LibraryAsset{all_library_ref, asset});
return true;
});
@@ -121,6 +124,9 @@ static AssetItemTree build_catalog_tree(const bContext &C, const bNodeTree *node
}
asset_system::AssetCatalog *catalog = all_library->catalog_service->find_catalog(
item.get_catalog_id());
if (catalog == nullptr) {
return;
}
catalogs_with_node_assets.insert_item(*catalog);
});