Fix iterator advancement

This commit is contained in:
Dan Paulat 2024-12-01 09:38:34 -06:00
parent 608b1af24f
commit 5be8d7b7c0

View file

@ -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_);