Replace == null with is null

This commit is contained in:
Bond_009
2022-12-05 15:00:20 +01:00
parent b2def4c9ea
commit c7d50d640e
206 changed files with 627 additions and 627 deletions

View File

@@ -41,7 +41,7 @@ namespace Jellyfin.Server.Implementations.Users
// This is the version that we need to use for local users. Because reasons.
public Task<ProviderAuthenticationResult> Authenticate(string username, string password, User resolvedUser)
{
if (resolvedUser == null)
if (resolvedUser is null)
{
throw new AuthenticationException("Specified user does not exist.");
}
@@ -58,7 +58,7 @@ namespace Jellyfin.Server.Implementations.Users
}
// Handle the case when the stored password is null, but the user tried to login with a password
if (resolvedUser.Password == null)
if (resolvedUser.Password is null)
{
throw new AuthenticationException("Invalid username or password");
}

View File

@@ -34,7 +34,7 @@ namespace Jellyfin.Server.Implementations.Users
.FirstOrDefault(pref =>
pref.UserId.Equals(userId) && string.Equals(pref.Client, client) && pref.ItemId.Equals(itemId));
if (prefs == null)
if (prefs is null)
{
prefs = new DisplayPreferences(userId, itemId, client);
_dbContext.DisplayPreferences.Add(prefs);
@@ -49,7 +49,7 @@ namespace Jellyfin.Server.Implementations.Users
var prefs = _dbContext.ItemDisplayPreferences
.FirstOrDefault(pref => pref.UserId.Equals(userId) && pref.ItemId.Equals(itemId) && string.Equals(pref.Client, client));
if (prefs == null)
if (prefs is null)
{
prefs = new ItemDisplayPreferences(userId, Guid.Empty, client);
_dbContext.ItemDisplayPreferences.Add(prefs);

View File

@@ -401,7 +401,7 @@ namespace Jellyfin.Server.Implementations.Users
var authenticationProvider = authResult.AuthenticationProvider;
var success = authResult.Success;
if (user == null)
if (user is null)
{
string updatedUsername = authResult.Username;
@@ -434,7 +434,7 @@ namespace Jellyfin.Server.Implementations.Users
}
}
if (user == null)
if (user is null)
{
_logger.LogInformation(
"Authentication request for {UserName} has been denied (IP: {IP}).",
@@ -708,7 +708,7 @@ namespace Jellyfin.Server.Implementations.Users
/// <inheritdoc/>
public async Task ClearProfileImageAsync(User user)
{
if (user.ProfileImage == null)
if (user.ProfileImage is null)
{
return;
}