Skip to content

Commit

Permalink
Replace redundant check with null conditional operator
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaskos-sonar committed Sep 25, 2024
1 parent 56b85a7 commit 6f9ed50
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/ConnectedMode/SlCoreConnectionAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,7 @@ public Task<AdapterResponseWithData<List<OrganizationDisplay>>> GetOrganizations

try
{
if (credentialsModel == null)
{
throw new ArgumentException($"Unexpected {nameof(ICredentialsModel)} argument");
}
var credentials = MapCredentials(credentialsModel.ToICredentials());
var credentials = MapCredentials(credentialsModel?.ToICredentials());
var response = await connectionConfigurationSlCoreService.ListUserOrganizationsAsync(new ListUserOrganizationsParams(credentials));
var organizationDisplays = response.userOrganizations.Select(o => new OrganizationDisplay(o.key, o.name)).ToList();

Expand Down

0 comments on commit 6f9ed50

Please sign in to comment.