Replace != null with is not null

This commit is contained in:
Bond_009
2022-12-05 15:01:13 +01:00
parent c7d50d640e
commit 52194f56b5
218 changed files with 928 additions and 928 deletions

View File

@@ -32,7 +32,7 @@ namespace Jellyfin.Server.Implementations.Security
public Task<AuthorizationInfo> GetAuthorizationInfo(HttpContext requestContext)
{
if (requestContext.Request.HttpContext.Items.TryGetValue("AuthorizationInfo", out var cached) && cached != null)
if (requestContext.Request.HttpContext.Items.TryGetValue("AuthorizationInfo", out var cached) && cached is not null)
{
return Task.FromResult((AuthorizationInfo)cached); // Cache should never contain null
}
@@ -72,7 +72,7 @@ namespace Jellyfin.Server.Implementations.Security
string? version = null;
string? token = null;
if (auth != null)
if (auth is not null)
{
auth.TryGetValue("DeviceId", out deviceId);
auth.TryGetValue("Device", out deviceName);
@@ -127,7 +127,7 @@ namespace Jellyfin.Server.Implementations.Security
{
var device = await dbContext.Devices.FirstOrDefaultAsync(d => d.AccessToken == token).ConfigureAwait(false);
if (device != null)
if (device is not null)
{
authInfo.IsAuthenticated = true;
var updateToken = false;
@@ -189,7 +189,7 @@ namespace Jellyfin.Server.Implementations.Security
else
{
var key = await dbContext.ApiKeys.FirstOrDefaultAsync(apiKey => apiKey.AccessToken == token).ConfigureAwait(false);
if (key != null)
if (key is not null)
{
authInfo.IsAuthenticated = true;
authInfo.Client = key.Name;