diff --git a/clients/roscpp/src/libros/statistics.cpp b/clients/roscpp/src/libros/statistics.cpp index 2b5811e5aa..2b0a1c299b 100644 --- a/clients/roscpp/src/libros/statistics.cpp +++ b/clients/roscpp/src/libros/statistics.cpp @@ -100,7 +100,10 @@ void StatisticsLogger::callback(const boost::shared_ptr& connection_he std_msgs::Header header; ros::serialization::IStream stream(m.message_start, m.num_bytes - (m.message_start - m.buf.get())); ros::serialization::deserialize(stream, header); - stats.age_list.push_back(received_time - header.stamp); + if (!header.stamp.isZero()) + { + stats.age_list.push_back(received_time - header.stamp); + } } catch (ros::serialization::StreamOverrunException& e) {