diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index eb203d23e77..150ee556b7e 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -3752,6 +3752,17 @@ void node_socket_move_default_value(Main & /*bmain*/, } } + /* Special handling for strings because the generic code below can't handle them. */ + if (src.type == SOCK_STRING && dst.type == SOCK_STRING && + dst_node.is_type("FunctionNodeInputString")) + { + auto *src_value = static_cast(src.default_value); + auto *dst_storage = static_cast(dst_node.storage); + MEM_SAFE_FREE(dst_storage->string); + dst_storage->string = BLI_strdup_null(src_value->value); + return; + } + void *src_value = socket_value_storage(src); if (!src_value) { return; @@ -3768,17 +3779,6 @@ void node_socket_move_default_value(Main & /*bmain*/, return; } - /* Special handling for strings because the generic code below can't handle them. */ - if (src.type == SOCK_STRING && dst.type == SOCK_STRING && - dst_node.is_type("FunctionNodeInputString")) - { - auto *src_value = static_cast(src.default_value); - auto *dst_storage = static_cast(dst_node.storage); - MEM_SAFE_FREE(dst_storage->string); - dst_storage->string = BLI_strdup_null(src_value->value); - return; - } - void *dst_value = node_static_value_storage_for(dst_node, dst); if (!dst_value) { return;