diff --git a/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp b/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp index 8df1c4bdbb..b2d4468ae6 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_graph.cpp @@ -377,7 +377,7 @@ std::vector convert_to_topic_info_list(const rcl_topic_endpoint_info_array_t & info_array) { std::vector topic_info_list; - for (size_t i = 0; i < info_array.count; ++i) { + for (size_t i = 0; i < info_array.size; ++i) { topic_info_list.push_back(rclcpp::TopicEndpointInfo(info_array.info_array[i])); } return topic_info_list;