diff options
author | Hans Goudey <h.goudey@me.com> | 2021-03-05 19:13:42 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-03-05 19:13:42 +0300 |
commit | f882bee4311d22fef01f33d95a6386a6ee2bef02 (patch) | |
tree | 3bd1b38c4774ed53a6d6282b74dd6722ff030e70 | |
parent | d5c727c6ea5f52201ba92a2a7a4d92f1cb7a4138 (diff) |
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.
-rw-r--r-- | source/blender/blenkernel/intern/node_ui_storage.cc | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |