Fix nullability errors in Jellyfin.Server.Implementations

This commit is contained in:
crobibero 2020-11-13 08:32:24 -07:00
parent 38885ffd74
commit 57b1e93411

View File

@ -54,12 +54,17 @@ namespace Jellyfin.Server.Implementations.Users
var usersReset = new List<string>();
foreach (var resetFile in Directory.EnumerateFiles(_passwordResetFileBaseDir, $"{BaseResetFileName}*"))
{
SerializablePasswordReset spr;
SerializablePasswordReset? spr;
await using (var str = File.OpenRead(resetFile))
{
spr = await JsonSerializer.DeserializeAsync<SerializablePasswordReset>(str).ConfigureAwait(false);
}
if (spr == null)
{
throw new NullReferenceException(nameof(spr));
}
if (spr.ExpirationDate < DateTime.UtcNow)
{
File.Delete(resetFile);