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:
@@ -84,6 +84,8 @@ void MovingAverageRegressionCurveCalculator::calculateValuesCentral(
|
|||||||
RegressionCalculationHelper::tDoubleVectorPair aValues)
|
RegressionCalculationHelper::tDoubleVectorPair aValues)
|
||||||
{
|
{
|
||||||
const size_t aSize = aValues.first.size();
|
const size_t aSize = aValues.first.size();
|
||||||
|
if (aSize == 0)
|
||||||
|
return;
|
||||||
for (size_t i = mPeriod - 1; i < aSize; ++i)
|
for (size_t i = mPeriod - 1; i < aSize; ++i)
|
||||||
{
|
{
|
||||||
double yAvg = 0.0;
|
double yAvg = 0.0;
|
||||||
|
Reference in New Issue
Block a user