mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 15:48:03 +00:00
Use pattern matching for null checks (#13793)
Fix the few that slipped through
This commit is contained in:
@@ -87,7 +87,7 @@ public class UserControllerTests
|
||||
Assert.Contains(
|
||||
Validate(userPolicy), v =>
|
||||
v.MemberNames.Contains("PasswordResetProviderId") &&
|
||||
v.ErrorMessage != null &&
|
||||
v.ErrorMessage is not null &&
|
||||
v.ErrorMessage.Contains("required", StringComparison.CurrentCultureIgnoreCase));
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ public class UserControllerTests
|
||||
|
||||
Assert.Contains(Validate(userPolicy), v =>
|
||||
v.MemberNames.Contains("AuthenticationProviderId") &&
|
||||
v.ErrorMessage != null &&
|
||||
v.ErrorMessage is not null &&
|
||||
v.ErrorMessage.Contains("required", StringComparison.CurrentCultureIgnoreCase));
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public class StreamInfoTests
|
||||
/// <returns>An <see cref="Array"/> of <see cref="Type"/>.</returns>
|
||||
private static object? RandomArray(Random random, Type? elementType)
|
||||
{
|
||||
if (elementType == null)
|
||||
if (elementType is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public class StreamInfoTests
|
||||
|
||||
var type = property.PropertyType;
|
||||
// If nullable, then set it to null, 25% of the time.
|
||||
if (Nullable.GetUnderlyingType(type) != null)
|
||||
if (Nullable.GetUnderlyingType(type) is not null)
|
||||
{
|
||||
if (random.Next(0, 4) == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user