diff --git a/PKHeX.Core/PKM/Util/PKX.cs b/PKHeX.Core/PKM/Util/PKX.cs index cebca857d..b33f88aef 100644 --- a/PKHeX.Core/PKM/Util/PKX.cs +++ b/PKHeX.Core/PKM/Util/PKX.cs @@ -796,9 +796,9 @@ public static string[] GetPKMExtensions(int maxGeneration = Generation) /// Format hint that the file is. public static int GetPKMFormatFromExtension(string ext, int prefer) { - return ext?.Length > 1 - ? GetPKMFormatFromExtension(ext[ext.Length - 1], prefer) - : prefer; + if (string.IsNullOrEmpty(ext)) + return prefer; + return GetPKMFormatFromExtension(ext[ext.Length - 1], prefer); } ///