Signed-off-by: Benjamin ROBIN <dev@xxxxxxxxxxxxx> --- src/KsPlotTools.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/KsPlotTools.cpp b/src/KsPlotTools.cpp index 1d63a9b..f362eaa 100644 --- a/src/KsPlotTools.cpp +++ b/src/KsPlotTools.cpp @@ -318,6 +318,9 @@ ksplot_point Shape::center() const { ksplot_point c = {0, 0}; + if (_nPoints == 0) + return c; + for (size_t i = 0; i < _nPoints; ++i) { c.x += _points[i].x; c.y += _points[i].y; -- 2.43.0