Apply suggestions from code review

Co-authored-by: Michael Nebel <michaelnebel@github.com>
This commit is contained in:
Michael B. Gale
2025-03-17 14:24:04 +00:00
committed by GitHub
parent 284f612965
commit 51874b8ef0
2 changed files with 3 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
// The value of the environment variable should be a JSON array of objects, such as:
// [ { "type": "nuget_feed", "url": "https://nuget.pkg.github.com/org/index.json" } ]
var array = JsonConvert.DeserializeObject<List<RegistryConfig>>(registryURLs);
if (array != null)
if (array is not null)
{
foreach (RegistryConfig config in array)
{

View File

@@ -267,7 +267,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
// `nuget.config` files instead of the command-line arguments.
HashSet<string>? sources = null;
if (this.dependabotProxy != null)
if (this.dependabotProxy is not null)
{
// If the Dependabot proxy is configured, then our main goal is to make `dotnet` aware
// of the private registry feeds. However, since providing them as command-line arguments
@@ -275,7 +275,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
// we have discovered from analysing `nuget.config` files.
sources = configuredSources ?? new();
sources.Add(PublicNugetOrgFeed);
this.dependabotProxy?.RegistryURLs.ForEach(url => sources.Add(url));
this.dependabotProxy.RegistryURLs.ForEach(url => sources.Add(url));
}
var successCount = 0;