From 67bd678887d7f8aec9f3b23bbf1aaf29f80d0da4 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 18 Mar 2024 14:36:43 +0100 Subject: [PATCH] Fix #119578: crash when node tool does not have geometry as first output socket This was simply missing a check and error message. The same error message is shown when the node group is used as modifier. Pull Request: https://projects.blender.org/blender/blender/pulls/119604 --- source/blender/editors/geometry/node_group_operator.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/blender/editors/geometry/node_group_operator.cc b/source/blender/editors/geometry/node_group_operator.cc index a0bd79e50a6..d5fc6b73a28 100644 --- a/source/blender/editors/geometry/node_group_operator.cc +++ b/source/blender/editors/geometry/node_group_operator.cc @@ -403,6 +403,12 @@ static int run_node_group_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } } + if (node_tree->interface_outputs().is_empty() || + !STREQ(node_tree->interface_outputs()[0]->socket_type, "NodeSocketGeometry")) + { + BKE_report(op->reports, RPT_ERROR, "Node group's first output must be a geometry"); + return OPERATOR_CANCELLED; + } IDProperty *properties = replace_inputs_evaluated_data_blocks(*op->properties, *depsgraph); BLI_SCOPED_DEFER([&]() { IDP_FreeProperty_ex(properties, false); });