From 4266ad3085e9f475ede502ff5c54b3eebb909866 Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Fri, 28 Feb 2020 09:57:06 +0200 Subject: [PATCH] Fix list indexing error in updateFixedLengths. gitlab #94 Change-Id: I70402e5ca920b44bfc0fa0647429c12595cca08b --- .../simantics/plant3d/scenegraph/controlpoint/PipingRules.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java index 8864ffd8..542534c3 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java @@ -761,7 +761,7 @@ public class PipingRules { double curr = gapObj.d; int d = 1; while (d < gaps.size() && curr < -MIN_INLINE_LENGTH) { - GapObj next = i+d >= 0 ? gaps.get(i+d) : null; + GapObj next = i+d < gaps.size() ? gaps.get(i+d) : null; GapObj prev = i-d >= 0 ? gaps.get(i-d) : null; if (next != null && next.gap == Gap.SPACE) { double move = Math.min(-curr, next.d); -- 2.47.1