Fix underlying ArrayIndexOutOfBounds exception 00/14200/2
Bruno JOFRET [Fri, 28 Mar 2014 10:22:38 +0000 (11:22 +0100)]
Change-Id: Ibf85d6c2b9254221ad9bba1a890582e019c9f239

scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/AxisDrawer.java

index d032871..26c91ca 100644 (file)
@@ -361,7 +361,7 @@ public class AxisDrawer {
             // Should find right index through given labels.
             String[] ticksLabel = axis.getTicksLabels();
             int index = (int) Math.round(value * (ticksLabel.length - 1));
-            if ((index < 0) || (index > ticksLabel.length)) {
+            if ((index < 0) || (index > ticksLabel.length) || ticksLabel.length == 0) {
                 return null;
             } else {
                 return ticksLabel[index];