From bb5622f5db8a3309ccd6c85850a8b8d9d92caa38 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 11 May 2018 21:09:39 -0700 Subject: [PATCH] Fix greninja import pass null forms thru the converter Closes #1937 --- PKHeX.Core/PKM/ShowdownSet.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/PKHeX.Core/PKM/ShowdownSet.cs b/PKHeX.Core/PKM/ShowdownSet.cs index f316d04d6..2d368138f 100644 --- a/PKHeX.Core/PKM/ShowdownSet.cs +++ b/PKHeX.Core/PKM/ShowdownSet.cs @@ -463,9 +463,7 @@ private static string ConvertFormToShowdown(string form, int spec) } private static string ConvertFormFromShowdown(string form, int spec, int ability) { - if (string.IsNullOrWhiteSpace(form)) - return null; - form = form.Replace(" ", "-"); // inconsistencies are great + form = form?.Replace(" ", "-"); // inconsistencies are great switch (spec) { case 550 when form == "Blue-Striped": // Basculin @@ -499,7 +497,7 @@ private static string ConvertFormFromShowdown(string form, int spec, int ability return "Dawn"; default: - if (Legal.Totem_USUM.Contains(spec) && form.EndsWith("Totem")) + if (Legal.Totem_USUM.Contains(spec) && form != null && form.EndsWith("Totem")) return "Large"; return form; }