Fix nullability errors in Jellyfin.Server.Implementations
This commit is contained in:
parent
38885ffd74
commit
57b1e93411
|
@ -54,12 +54,17 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
var usersReset = new List<string>();
|
var usersReset = new List<string>();
|
||||||
foreach (var resetFile in Directory.EnumerateFiles(_passwordResetFileBaseDir, $"{BaseResetFileName}*"))
|
foreach (var resetFile in Directory.EnumerateFiles(_passwordResetFileBaseDir, $"{BaseResetFileName}*"))
|
||||||
{
|
{
|
||||||
SerializablePasswordReset spr;
|
SerializablePasswordReset? spr;
|
||||||
await using (var str = File.OpenRead(resetFile))
|
await using (var str = File.OpenRead(resetFile))
|
||||||
{
|
{
|
||||||
spr = await JsonSerializer.DeserializeAsync<SerializablePasswordReset>(str).ConfigureAwait(false);
|
spr = await JsonSerializer.DeserializeAsync<SerializablePasswordReset>(str).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (spr == null)
|
||||||
|
{
|
||||||
|
throw new NullReferenceException(nameof(spr));
|
||||||
|
}
|
||||||
|
|
||||||
if (spr.ExpirationDate < DateTime.UtcNow)
|
if (spr.ExpirationDate < DateTime.UtcNow)
|
||||||
{
|
{
|
||||||
File.Delete(resetFile);
|
File.Delete(resetFile);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user