C#: Update the extractor to use the BestOrDefault extension method to choose between multiple locations.

This commit is contained in:
Michael Nebel
2024-06-25 15:50:44 +02:00
parent dd65d960be
commit e15a47d58c
12 changed files with 12 additions and 13 deletions

View File

@@ -379,7 +379,7 @@ namespace Semmle.Extraction
{
if (!(optionalSymbol is null))
{
ExtractionError(message, optionalSymbol.ToDisplayString(), CreateLocation(optionalSymbol.Locations.FirstOrDefault()));
ExtractionError(message, optionalSymbol.ToDisplayString(), CreateLocation(optionalSymbol.Locations.BestOrDefault()));
}
else if (!(optionalEntity is null))
{