diff --git a/tools/apiview/parsers/csharp-api-parser/CSharpAPIParser/Program.cs b/tools/apiview/parsers/csharp-api-parser/CSharpAPIParser/Program.cs index b210b13fcee..59db4d3b6f9 100644 --- a/tools/apiview/parsers/csharp-api-parser/CSharpAPIParser/Program.cs +++ b/tools/apiview/parsers/csharp-api-parser/CSharpAPIParser/Program.cs @@ -49,8 +49,8 @@ static async Task HandlePackageFileParsing(Stream stream, FileInfo packageFilePa ZipArchive? zipArchive = null; Stream? dllStream = stream; Stream? docStream = null; - List? dependencies = null; - string dependencyFilesTempDir = null; + List? dependencies = new List(); + string? dependencyFilesTempDir = null; try { @@ -85,7 +85,6 @@ static async Task HandlePackageFileParsing(Stream stream, FileInfo packageFilePa using var nuspecStream = nuspecEntry.Open(); var document = XDocument.Load(nuspecStream); var dependencyElements = document.Descendants().Where(e => e.Name.LocalName == "dependency"); - dependencies = new List(); dependencies.AddRange( dependencyElements.Select(dependency => new DependencyInfo( dependency.Attribute("id")?.Value,