Janitor : Guard access to empty vector

This commit is contained in:
Magne Sjaastad
2021-10-19 11:54:58 +02:00
parent d1d072140e
commit da30992d5a

View File

@@ -295,8 +295,11 @@ std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
}
else
{
// The last point is added without interpolation
value = sourceValues.back();
if ( !sourceValues.empty() )
{
// The last point is added without interpolation
value = sourceValues.back();
}
}
interpolatedValues.push_back( value );