Commit: 761e6b1b78da9bcfdb4bafdd2a9db062c8d4963c
Author: Jacques Lucke
Date:   Fri Jan 13 17:25:20 2023 +0100
Branches: master
https://developer.blender.org/rB761e6b1b78da9bcfdb4bafdd2a9db062c8d4963c

Fix: crash when opening node add menu

Differential Revision: https://developer.blender.org/D16995

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

M       source/blender/editors/space_node/add_menu_assets.cc

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

diff --git a/source/blender/editors/space_node/add_menu_assets.cc 
b/source/blender/editors/space_node/add_menu_assets.cc
index 912493c3e7e..060e8914194 100644
--- a/source/blender/editors/space_node/add_menu_assets.cc
+++ b/source/blender/editors/space_node/add_menu_assets.cc
@@ -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);
   });

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to