Skip to content

Commit

Permalink
Add check in rcl_remap_name instead
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolai Morin <nikolai.morin@apex.ai>
  • Loading branch information
nnmm committed Dec 18, 2020
1 parent 622068b commit 3fed3b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rcl/src/rcl/remap.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ rcl_remap_first_match(
}
continue;
}
if (NULL != name) {
matched = (0 == strcmp(expanded_match, name));
}
matched = (0 == strcmp(expanded_match, name));
allocator.deallocate(expanded_match, allocator.state);
} else {
// nodename and namespace replacement apply if the type and node name prefix checks passed
Expand Down Expand Up @@ -174,6 +172,9 @@ rcl_remap_name(
{
RCL_CHECK_ARGUMENT_FOR_NULL(node_name, RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_ARGUMENT_FOR_NULL(output_name, RCL_RET_INVALID_ARGUMENT);
if (type_bitmask & (RCL_TOPIC_REMAP | RCL_SERVICE_REMAP)) {
RCL_CHECK_ARGUMENT_FOR_NULL(name, RCL_RET_INVALID_ARGUMENT);
}
if (NULL != local_arguments && NULL == local_arguments->impl) {
local_arguments = NULL;
}
Expand Down

0 comments on commit 3fed3b1

Please sign in to comment.