[Bf-blender-cvs] [f882bee4311] master: Fix crash with pinned geometry node tree with no active object

Hans Goudey noreply at git.blender.org
Fri Mar 5 17:13:48 CET 2021


Commit: f882bee4311d22fef01f33d95a6386a6ee2bef02
Author: Hans Goudey
Date:   Fri Mar 5 10:13:42 2021 -0600
Branches: master
https://developer.blender.org/rBf882bee4311d22fef01f33d95a6386a6ee2bef02

Fix crash with pinned geometry node tree with no active object

The check for a null active object was after trying to retrieve the active
modifier from the object.

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

M	source/blender/blenkernel/intern/node_ui_storage.cc

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

diff --git a/source/blender/blenkernel/intern/node_ui_storage.cc b/source/blender/blenkernel/intern/node_ui_storage.cc
index 6e0253eca31..97f52dd3727 100644
--- a/source/blender/blenkernel/intern/node_ui_storage.cc
+++ b/source/blender/blenkernel/intern/node_ui_storage.cc
@@ -62,8 +62,12 @@ const NodeUIStorage *BKE_node_tree_ui_storage_get_from_context(const bContext *C
   }
 
   const Object *active_object = CTX_data_active_object(C);
+  if (active_object == nullptr) {
+    return nullptr;
+  }
+
   const ModifierData *active_modifier = BKE_object_active_modifier(active_object);
-  if (active_object == nullptr || active_modifier == nullptr) {
+  if (active_modifier == nullptr) {
     return nullptr;
   }



More information about the Bf-blender-cvs mailing list