Fix possible null reference

This commit is contained in:
Cj 2024-08-09 23:42:34 -04:00
parent 496be90eb8
commit 67aae1178b

View File

@ -231,11 +231,12 @@ public class ReCodeItRemapper
if (remap.TypeCandidates.Count == 0 || remap.Succeeded) { return; }
var winner = remap.TypeCandidates.FirstOrDefault();
if (winner is null) { return; }
remap.TypePrimeCandidate = winner;
remap.OriginalTypeName = winner.Name.String;
if (winner is null) { return; }
if (_alreadyGivenNames.Contains(winner.FullName))
{
remap.NoMatchReasons.Add(ENoMatchReason.AmbiguousWithPreviousMatch);