diff --git a/rcl/src/rcl/graph.c b/rcl/src/rcl/graph.c index 756f15dbb..3e63c45dd 100644 --- a/rcl/src/rcl/graph.c +++ b/rcl/src/rcl/graph.c @@ -352,6 +352,13 @@ rcl_get_node_names( return RCL_RET_ERROR; } } + // Check that none of the node namespaces are NULL + for (size_t i = 0u; i < node_names->size; ++i) { + if (!node_namespaces->data[i]) { + RCL_SET_ERROR_MSG("NULL node namespace returned by the RMW layer"); + return RCL_RET_ERROR; + } + } return RCL_RET_OK; }