diff --git a/core/src/processing/data/IntList.java b/core/src/processing/data/IntList.java index afb4c6cd61..83cac6b3f7 100644 --- a/core/src/processing/data/IntList.java +++ b/core/src/processing/data/IntList.java @@ -6,6 +6,7 @@ import java.util.Iterator; import java.util.Random; +import org.jetbrains.annotations.TestOnly; import processing.core.PApplet; @@ -164,13 +165,14 @@ public void clear() { * @webBrief Get an entry at a particular index */ public int get(int index) { - if (index >= this.count) { + if (index >= this.count || index < 0) { throw new ArrayIndexOutOfBoundsException(index); } return data[index]; } + /** * Set the entry at a particular index. *