Skip to content

Commit

Permalink
Separate error messages for null vs empty
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Perron <[email protected]>
  • Loading branch information
jacobperron committed Mar 12, 2020
1 parent f8589d9 commit 922f2e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rcl/src/rcl/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,12 @@ rcl_get_node_names(

// Check that none of the node names are NULL or empty
for (size_t i = 0u; i < node_names->size; ++i) {
if (!node_names->data[i] || !strcmp(node_names->data[i], "")) {
RCL_SET_ERROR_MSG("NULL or empty node name returned by the RMW layer");
if (!node_names->data[i]) {
RCL_SET_ERROR_MSG("NULL node name returned by the RMW layer");
return RCL_RET_ERROR;
}
if (!strcmp(node_names->data[i], "")) {
RCL_SET_ERROR_MSG("empty node name returned by the RMW layer");
return RCL_RET_ERROR;
}
}
Expand Down

0 comments on commit 922f2e8

Please sign in to comment.