diff --git a/tools/rosbag_storage/src/view.cpp b/tools/rosbag_storage/src/view.cpp index 81cae14ed8..dbb1e72478 100644 --- a/tools/rosbag_storage/src/view.cpp +++ b/tools/rosbag_storage/src/view.cpp @@ -136,7 +136,7 @@ void View::iterator::increment() { { std::multiset::const_iterator last_iter = iters_.back().iter; - while (iters_.back().iter == last_iter) + while (!iters_.empty() && iters_.back().iter == last_iter) { iters_.back().iter++; if (iters_.back().iter == iters_.back().range->end)