Skip to content

Commit

Permalink
Fix null initial name
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed May 15, 2024
1 parent 3b59475 commit 7307033
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,15 @@ private static async Task<bool> HasReferenceToAssemblyAsync(Project project, str

using (await s_metadataIdToAssemblyNameGate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false))
{
// Overwrite an existing null name with a non-null one.
if (s_metadataIdToAssemblyName.TryGetValue(metadataId, out var existingName) &&
existingName == null &&
name != null)
{
s_metadataIdToAssemblyName[metadataId] = name;
}

// Return whatever is in the map, adding ourselves if something is not already there.
name = s_metadataIdToAssemblyName.GetOrAdd(metadataId, name);
}

Expand Down

0 comments on commit 7307033

Please sign in to comment.