diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-04-17 09:38:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-04-17 17:03:26 +0200 |
commit | 13a2ca25e4b16a6ac310c03ec9b543c774a0df6c (patch) | |
tree | 94b3810c3deea8ed87bd60d3201e73996df6221d /chart2 | |
parent | 7773932ba7c4bafeed7fba0a5d87f75eed09f850 (diff) |
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>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx index 6236f73b398d..6726d9d78b36 100644 --- a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx +++ b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx @@ -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; |