From 5be8d7b7c05d36d6fce507ba73498b8efc765a76 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Sun, 1 Dec 2024 09:38:34 -0600 Subject: [PATCH] Fix iterator advancement --- scwx-qt/source/scwx/qt/view/level2_product_view.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scwx-qt/source/scwx/qt/view/level2_product_view.cpp b/scwx-qt/source/scwx/qt/view/level2_product_view.cpp index d6d08dce..ca285582 100644 --- a/scwx-qt/source/scwx/qt/view/level2_product_view.cpp +++ b/scwx-qt/source/scwx/qt/view/level2_product_view.cpp @@ -703,7 +703,14 @@ void Level2ProductView::ComputeSweep() std::int32_t numberOfNextDataMomentGates = 0; if (smoothingEnabled) { - const auto& nextRadialPair = *(++it); + // Smoothing requires the next radial pair as well + auto nextIt = std::next(it); + if (nextIt == radarData->cend()) + { + continue; + } + + const auto& nextRadialPair = *(nextIt); const auto& nextRadialData = nextRadialPair.second; nextMomentData = nextRadialData->moment_data_block(p->dataBlockType_);