diff --git a/source/blender/nodes/intern/derived_node_tree.cc b/source/blender/nodes/intern/derived_node_tree.cc index ac207ff2212..7cbbcb83c4f 100644 --- a/source/blender/nodes/intern/derived_node_tree.cc +++ b/source/blender/nodes/intern/derived_node_tree.cc @@ -350,7 +350,14 @@ const DTreeContext &DerivedNodeTree::active_context() const return root_context(); } - return *find_active_context_recursive(&root_context()); + const DTreeContext *found_context = find_active_context_recursive(&root_context()); + if (found_context == nullptr) { + /* There should always be a valid active context. */ + BLI_assert_unreachable(); + return root_context(); + } + + return *found_context; } /* Each nested node group gets its own cluster. Just as node groups, clusters can be nested. */