Skip to content

Commit 51874b8

Browse files
mbgmichaelnebel
andauthored
Apply suggestions from code review
Co-authored-by: Michael Nebel <[email protected]>
1 parent 284f612 commit 51874b8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DependabotProxy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public struct RegistryConfig
9797
// The value of the environment variable should be a JSON array of objects, such as:
9898
// [ { "type": "nuget_feed", "url": "https://nuget.pkg.github.com/org/index.json" } ]
9999
var array = JsonConvert.DeserializeObject<List<RegistryConfig>>(registryURLs);
100-
if (array != null)
100+
if (array is not null)
101101
{
102102
foreach (RegistryConfig config in array)
103103
{

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,15 @@ private void RestoreProjects(IEnumerable<string> projects, HashSet<string>? conf
267267
// `nuget.config` files instead of the command-line arguments.
268268
HashSet<string>? sources = null;
269269

270-
if (this.dependabotProxy != null)
270+
if (this.dependabotProxy is not null)
271271
{
272272
// If the Dependabot proxy is configured, then our main goal is to make `dotnet` aware
273273
// of the private registry feeds. However, since providing them as command-line arguments
274274
// to `dotnet` ignores other feeds that may be configured, we also need to add the feeds
275275
// we have discovered from analysing `nuget.config` files.
276276
sources = configuredSources ?? new();
277277
sources.Add(PublicNugetOrgFeed);
278-
this.dependabotProxy?.RegistryURLs.ForEach(url => sources.Add(url));
278+
this.dependabotProxy.RegistryURLs.ForEach(url => sources.Add(url));
279279
}
280280

281281
var successCount = 0;

0 commit comments

Comments
 (0)