]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java
Fix list indexing error in updateFixedLengths.
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / scenegraph / controlpoint / PipingRules.java
index 8864ffd8cc8cda8fde18258fc756404d9a9066ec..542534c3eebf983af835d4deefc7d735f70a5ee4 100644 (file)
@@ -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);