diff --git a/rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp b/rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp index c25af15422..e1a0b1e1e7 100644 --- a/rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp +++ b/rclcpp/test/rclcpp/node_interfaces/test_node_graph.cpp @@ -131,7 +131,8 @@ TEST_F(TestNodeGraph, construct_from_node) EXPECT_NE(nullptr, node_graph()->get_graph_guard_condition()); // get_graph_event is non-const - EXPECT_NE(nullptr, node()->get_node_graph_interface()->get_graph_event()); + auto event = node()->get_node_graph_interface()->get_graph_event(); + EXPECT_NE(nullptr, event); EXPECT_LE(1u, node_graph()->count_graph_users()); }