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