Resolves: tdf#146068 don't crash when MA(central) lacks data

Change-Id: I2c9b78f4d1a963bb71abb21068e61e6983ade777
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150484
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2023-04-17 09:38:45 +01:00
parent 7773932ba7
commit 13a2ca25e4

View File

@@ -84,6 +84,8 @@ void MovingAverageRegressionCurveCalculator::calculateValuesCentral(
RegressionCalculationHelper::tDoubleVectorPair aValues)
{
const size_t aSize = aValues.first.size();
if (aSize == 0)
return;
for (size_t i = mPeriod - 1; i < aSize; ++i)
{
double yAvg = 0.0;