Skip to content

Commit

Permalink
allow null in sdk settings
Browse files Browse the repository at this point in the history
  • Loading branch information
crobibero committed Feb 23, 2024
1 parent 9dd177e commit d4bcfe9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Jellyfin.Sdk/JellyfinSdkSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void Initialize(
/// Set the server url.
/// </summary>
/// <param name="serverUrl">The server url.</param>
public void SetServerUrl(string serverUrl)
public void SetServerUrl(string? serverUrl)
{
ServerUrl = serverUrl;
}
Expand All @@ -114,9 +114,12 @@ public void SetServerUrl(string serverUrl)
/// Set the access token.
/// </summary>
/// <param name="accessToken">The access token.</param>
public void SetAccessToken(string accessToken)
public void SetAccessToken(string? accessToken)
{
AccessToken = accessToken;
_authTokenHeader = $"{AuthScheme} Token=\"{accessToken}\"";

_authTokenHeader = string.IsNullOrEmpty(accessToken)
? null
: $"{AuthScheme} Token=\"{accessToken}\"";
}
}

0 comments on commit d4bcfe9

Please sign in to comment.