From 5b58716ffdbed4a83b8c4d4e7ae96a6a3b23d7ca Mon Sep 17 00:00:00 2001 From: Robert van der Hulst Date: Mon, 22 Jan 2024 16:06:27 +0100 Subject: [PATCH] The excludedTypeNames local should not be initialized from the AssemblyNames property --- .../PublicizeInternals.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/IgnoresAccessChecksToGenerator.Tasks/PublicizeInternals.cs b/src/IgnoresAccessChecksToGenerator.Tasks/PublicizeInternals.cs index 9f3cbab..a93c781 100644 --- a/src/IgnoresAccessChecksToGenerator.Tasks/PublicizeInternals.cs +++ b/src/IgnoresAccessChecksToGenerator.Tasks/PublicizeInternals.cs @@ -37,7 +37,11 @@ public override bool Execute() return true; } - var excludedTypeNames = new HashSet(AssemblyNames.Select(t => t.ItemSpec), StringComparer.OrdinalIgnoreCase); + var excludedTypeNames = new HashSet(StringComparer.OrdinalIgnoreCase); + if (ExcludeTypeNames != null) + { + excludedTypeNames = new HashSet(ExcludeTypeNames.Select(t => t.ItemSpec), StringComparer.OrdinalIgnoreCase); + } var targetPath = IntermediateOutputPath; Directory.CreateDirectory(targetPath);