Fix greninja import

pass null forms thru the converter
Closes #1937
This commit is contained in:
Kurt 2018-05-11 21:09:39 -07:00
parent c2644cc9f0
commit bb5622f5db

View File

@ -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;
}