[Bf-blender-cvs] [6b662ebdb9a] master: Cleanup: Return early
Hans Goudey
noreply at git.blender.org
Thu Dec 23 00:18:45 CET 2021
Commit: 6b662ebdb9a6e6dd08a1df46e2f2eb2c525b30bd
Author: Hans Goudey
Date: Wed Dec 22 17:18:37 2021 -0600
Branches: master
https://developer.blender.org/rB6b662ebdb9a6e6dd08a1df46e2f2eb2c525b30bd
Cleanup: Return early
===================================================================
M source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc
===================================================================
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 ¶ms)
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 ¶ms) {
- 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 ¶ms) {
+ 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 ¶ms) {
More information about the Bf-blender-cvs
mailing list