From 523c03606e591d1e94f4e55a45d6aed034a0f560 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 17 Nov 2017 17:07:12 -0800 Subject: [PATCH] Add guard check for out of range gen1 species Thanks ShadowMario3! --- PKHeX.Core/PKM/SpeciesConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PKHeX.Core/PKM/SpeciesConverter.cs b/PKHeX.Core/PKM/SpeciesConverter.cs index c146d56a0..78daff121 100644 --- a/PKHeX.Core/PKM/SpeciesConverter.cs +++ b/PKHeX.Core/PKM/SpeciesConverter.cs @@ -21,7 +21,7 @@ internal static class SpeciesConverter /// /// National Dex ID. /// Generation 1 species ID. - public static int SetG1Species(int dex_id) => table1_Internal[dex_id]; + public static int SetG1Species(int dex_id) => dex_id >= table1_Internal.Length ? 0 : table1_Internal[dex_id]; /// /// Converts a National Dex ID to Generation 3 species ID.