Skip to content

Commit 9717bc2

Browse files
PsifourGrover-c13
authored andcommitted
Fixes an ArrayOutOfBoundsException (#411)
Fixes an ArrayOutOfBoundsException in EvolutionInfo. Currently it takes the length of an array as an index in the array which will result in an exception being thrown anytime this function is called.
1 parent 82fefdb commit 9717bc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/pokegoapi/api/pokemon/EvolutionInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public static List<EvolutionForm> getEvolutionForms(PokemonId pokemonId) {
426426
*/
427427
public static boolean isFullyEvolved(PokemonId pokemonId) {
428428
PokemonId[] info = EVOLUTION_INFO.get(pokemonId);
429-
return info[info.length] == pokemonId;
429+
return info[info.length - 1] == pokemonId;
430430
}
431431

432432
/**

0 commit comments

Comments
 (0)