Guard against an ArrayIndexOutOfBoundsException the other way