Skip to content

Commit

Permalink
use TryGetValue method
Browse files Browse the repository at this point in the history
  • Loading branch information
testfirstcoder committed Aug 20, 2024
1 parent 1b990de commit 6521617
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ public static void SetSessionId(this AuthenticationProperties properties, string
/// <returns></returns>
public static IEnumerable<string> GetClientList(this AuthenticationProperties properties)
{
if (properties?.Items.ContainsKey(ClientListKey) == true)
if (properties?.Items.TryGetValue(ClientListKey, out var value) == true)
{
var value = properties.Items[ClientListKey];
return DecodeList(value);
}

return Enumerable.Empty<string>();
return [];
}

/// <summary>
Expand Down

0 comments on commit 6521617

Please sign in to comment.