Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-12-23 02:18:37 +0300
committerHans Goudey <h.goudey@me.com>2021-12-23 02:18:37 +0300
commit6b662ebdb9a6e6dd08a1df46e2f2eb2c525b30bd (patch)
tree1a5f9b1aee4433b0b7f10014e6a41fbbdbcca7e7 /source/blender/nodes
parent9033d270d5da1af874796d70a0f71c28a9f4c5da (diff)
Cleanup: Return early
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc
index e4f2e8ef7f4..4d6fb328ad9 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc
@@ -136,16 +136,18 @@ static void node_gather_link_searches(GatherLinkSearchOpParams &params)
search_link_ops_for_declarations(params, declaration.inputs().take_front(2));
const std::optional<CustomDataType> type = node_type_from_other_socket(params.other_socket());
+ if (!type) {
+ return;
+ }
+
if (params.in_out() == SOCK_IN) {
- if (type) {
- params.add_item(IFACE_("Attribute"), [node_type, type](LinkSearchOpParams &params) {
- bNode &node = params.add_node(node_type);
- node.custom1 = *type;
- params.update_and_connect_available_socket(node, "Attribute");
- });
- }
+ params.add_item(IFACE_("Attribute"), [node_type, type](LinkSearchOpParams &params) {
+ bNode &node = params.add_node(node_type);
+ node.custom1 = *type;
+ params.update_and_connect_available_socket(node, "Attribute");
+ });
}
- else if (type) {
+ else {
for (const SocketDeclarationPtr &socket_decl : declaration.outputs()) {
StringRefNull name = socket_decl->name();
params.add_item(IFACE_(name.c_str()), [node_type, name, type](LinkSearchOpParams &params) {