diff --git a/core/src/processing/data/FloatDict.java b/core/src/processing/data/FloatDict.java index 0e6873732..58d006149 100644 --- a/core/src/processing/data/FloatDict.java +++ b/core/src/processing/data/FloatDict.java @@ -491,6 +491,9 @@ public class FloatDict { public String removeIndex(int index) { + if (index < 0 || index >= count) { + throw new ArrayIndexOutOfBoundsException(index); + } String key = keys[index]; //System.out.println("index is " + which + " and " + keys[which]); indices.remove(keys[index]); diff --git a/core/src/processing/data/IntDict.java b/core/src/processing/data/IntDict.java index 971dc6e1e..ed22a27f7 100644 --- a/core/src/processing/data/IntDict.java +++ b/core/src/processing/data/IntDict.java @@ -502,6 +502,9 @@ public class IntDict { public String removeIndex(int index) { + if (index < 0 || index >= count) { + throw new ArrayIndexOutOfBoundsException(index); + } //System.out.println("index is " + which + " and " + keys[which]); String key = keys[index]; indices.remove(keys[index]); diff --git a/core/src/processing/data/StringDict.java b/core/src/processing/data/StringDict.java index bc3124835..afc7ea49a 100644 --- a/core/src/processing/data/StringDict.java +++ b/core/src/processing/data/StringDict.java @@ -292,6 +292,9 @@ public class StringDict { public String removeIndex(int index) { + if (index < 0 || index >= count) { + throw new ArrayIndexOutOfBoundsException(index); + } //System.out.println("index is " + which + " and " + keys[which]); String key = keys[index]; indices.remove(key);