From 67aae1178b9f6364bc42429aefd3e53b3dd3e332 Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Fri, 9 Aug 2024 23:42:34 -0400 Subject: [PATCH] Fix possible null reference --- RecodeItLib/Remapper/ReCodeItRemapper.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RecodeItLib/Remapper/ReCodeItRemapper.cs b/RecodeItLib/Remapper/ReCodeItRemapper.cs index 06bbed6..b0d6b63 100644 --- a/RecodeItLib/Remapper/ReCodeItRemapper.cs +++ b/RecodeItLib/Remapper/ReCodeItRemapper.cs @@ -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);