ArrayIndexOutOfBoundsException in AutoLayout.InterpolateDynamicProperty #1532
Closed
Description
See while loop at the line 335 at https://github.com/gephi/gephi/blob/master/modules/LayoutPlugin/src/main/java/org/gephi/layout/plugin/AutoLayout.java#L335:
while (thresholds[currentIndex] < ratio && currentIndex < thresholds.length) {
currentIndex++;
}
Please switch the order of those conditions, otherwise it can cause access to thresholds[thresholds.length]
resulting in:
java.lang.ArrayIndexOutOfBoundsException: 2
at org.gephi.layout.plugin.AutoLayout$InterpolateDynamicProperty.getValue(AutoLayout.java:335)
at org.gephi.layout.plugin.AutoLayout.setProperties(AutoLayout.java:138)
at org.gephi.layout.plugin.AutoLayout.execute(AutoLayout.java:124)