From 6322c8c753ea6b9162cffd17baeac4ee272d6ba5 Mon Sep 17 00:00:00 2001 From: namdre Date: Mon, 26 Feb 2024 19:08:12 +0100 Subject: [PATCH] fix #14413 --- src/utils/geom/PositionVector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/geom/PositionVector.cpp b/src/utils/geom/PositionVector.cpp index 2cdf17afd27f..b1907caffebb 100644 --- a/src/utils/geom/PositionVector.cpp +++ b/src/utils/geom/PositionVector.cpp @@ -1115,7 +1115,7 @@ PositionVector::intersectsAtLengths2D(const Position& lp1, const Position& lp2) void PositionVector::extrapolate(const double val, const bool onlyFirst, const bool onlyLast) { - if (size() > 0) { + if (size() > 1) { Position& p1 = (*this)[0]; Position& p2 = (*this)[1]; const Position offset = (p2 - p1) * (val / p1.distanceTo(p2)); @@ -1137,7 +1137,7 @@ PositionVector::extrapolate(const double val, const bool onlyFirst, const bool o void PositionVector::extrapolate2D(const double val, const bool onlyFirst) { - if (size() > 0) { + if (size() > 1) { Position& p1 = (*this)[0]; Position& p2 = (*this)[1]; if (p1.distanceTo2D(p2) > 0) {