Skip to content

Commit f4b7986

Browse files
authored
Fix nullability warning in WebScenarioTests.cs (#47907)
1 parent 7efc24d commit f4b7986

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SourceBuild/content/test/Microsoft.DotNet.SourceBuild.Tests/WebScenarioTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ private static void VerifyRuntimePacksForSelfContained(string projectPath)
6262

6363
string packagesDirectory = Path.Combine(Environment.CurrentDirectory, "packages");
6464

65-
IEnumerable<string> packages = restoredPackageFiles
65+
IEnumerable<string> packages = restoredPackageFiles.GetValues<string>()
66+
.Where(file => file is not null)
6667
.Select(file =>
6768
{
68-
string path = file.ToString();
69-
path = path.Substring(packagesDirectory.Length + 1); // trim the leading path up to the package name directory
69+
string path = file.Substring(packagesDirectory.Length + 1); // trim the leading path up to the package name directory
7070
return path.Substring(0, path.IndexOf('/')); // trim the rest of the path
7171
})
7272
.Except(allowedPackages, StringComparer.OrdinalIgnoreCase);

0 commit comments

Comments
 (0)