mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
Use null coalescing when possible
This commit is contained in:
@@ -57,12 +57,8 @@ namespace Jellyfin.Server.Implementations.Users
|
||||
SerializablePasswordReset? spr;
|
||||
await using (var str = File.OpenRead(resetFile))
|
||||
{
|
||||
spr = await JsonSerializer.DeserializeAsync<SerializablePasswordReset>(str).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (spr == null)
|
||||
{
|
||||
throw new ResourceNotFoundException(nameof(spr));
|
||||
spr = await JsonSerializer.DeserializeAsync<SerializablePasswordReset>(str).ConfigureAwait(false)
|
||||
?? throw new ResourceNotFoundException(nameof(spr));
|
||||
}
|
||||
|
||||
if (spr.ExpirationDate < DateTime.UtcNow)
|
||||
|
||||
Reference in New Issue
Block a user