X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=inline;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Fscenegraph%2Fcontrolpoint%2FPipingRules.java;h=542534c3eebf983af835d4deefc7d735f70a5ee4;hb=refs%2Fchanges%2F41%2F3941%2F1;hp=8864ffd8cc8cda8fde18258fc756404d9a9066ec;hpb=a3d63f1ba39c56c2b0236932965b9712654fad12;p=simantics%2F3d.git 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);