handle node names which are null (#435)
This commit is contained in:
parent
fa81d95e33
commit
45dcd0c6e5
1 changed files with 6 additions and 2 deletions
|
@ -149,8 +149,12 @@ NodeGraph::get_node_names() const
|
||||||
throw std::runtime_error(error_msg);
|
throw std::runtime_error(error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> node_names(&node_names_c.data[0],
|
std::vector<std::string> node_names(node_names_c.size);
|
||||||
&node_names_c.data[0 + node_names_c.size]);
|
for (size_t i = 0; i < node_names_c.size; ++i) {
|
||||||
|
if (node_names_c.data[i]) {
|
||||||
|
node_names[i] = node_names_c.data[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
ret = rcutils_string_array_fini(&node_names_c);
|
ret = rcutils_string_array_fini(&node_names_c);
|
||||||
if (ret != RCUTILS_RET_OK) {
|
if (ret != RCUTILS_RET_OK) {
|
||||||
// *INDENT-OFF*
|
// *INDENT-OFF*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue