From: Reino Ruusu Date: Fri, 28 Feb 2020 07:57:06 +0000 (+0200) Subject: Fix list indexing error in updateFixedLengths. X-Git-Tag: v1.43.0~55 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=4266ad3085e9f475ede502ff5c54b3eebb909866;p=simantics%2F3d.git Fix list indexing error in updateFixedLengths. gitlab #94 Change-Id: I70402e5ca920b44bfc0fa0647429c12595cca08b --- 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);