fix: Fixes TryParse for Race (#1244)

This commit is contained in:
Kamron Batman 2022-11-12 00:31:25 -08:00 committed by GitHub
parent 03fb36c869
commit 8e0d01d4be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,12 +137,8 @@ public abstract class Race : ISpanParsable<Race>
{
if (int.TryParse(s, out var index) && index >= 0 && index < Races.Length)
{
var race = Races[index];
if (race != null)
{
result = default;
return false;
}
result = Races[index];
return result != null;
}
s = s.Trim();