Fix T86677: select grouped in node editor crashes without active node

This was reported for geometry nodes, but was true for all nodetrees
(e.g. after deleting the active node). Geometry node trees just made
this more obvious since they start without an active node to begin with.

Fix provided by @lone_noel, thx!

Maniphest Tasks: T86677

Differential Revision: https://developer.blender.org/D10762
This commit is contained in:
2021-03-18 16:47:14 +01:00
parent cddfd11581
commit 1e1d96f0a8

View File

@@ -370,6 +370,11 @@ static int node_select_grouped_exec(bContext *C, wmOperator *op)
{
SpaceNode *snode = CTX_wm_space_node(C);
bNode *node_act = nodeGetActive(snode->edittree);
if (node_act == NULL) {
return OPERATOR_CANCELLED;
}
bNode *node;
bool changed = false;
const bool extend = RNA_boolean_get(op->ptr, "extend");