diff --git a/rosbag2_transport/src/rosbag2_transport/bag_rewrite.cpp b/rosbag2_transport/src/rosbag2_transport/bag_rewrite.cpp index 9a139ad3fb..2ef591131d 100644 --- a/rosbag2_transport/src/rosbag2_transport/bag_rewrite.cpp +++ b/rosbag2_transport/src/rosbag2_transport/bag_rewrite.cpp @@ -149,7 +149,7 @@ void perform_rewrite( next_messages.resize(input_bags.size(), nullptr); std::shared_ptr next_msg; - while (next_msg = get_next(input_bags, next_messages)) { + while ((next_msg = get_next(input_bags, next_messages))) { auto topic_writers = topic_outputs.find(next_msg->topic_name); if (topic_writers != topic_outputs.end()) { for (auto writer : topic_writers->second) {