From a39f917f845e8cd0aee5133ce8cbbbaeee9b24b3 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 9 Feb 2019 23:22:22 -0800 Subject: [PATCH] Simplify expression ternary with a null check and long method signature is pretty ugly --- PKHeX.Core/PKM/Util/PKX.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } ///