The Free Software Media System - Server Backend & API
Fix nullability errors in Jellyfin.Server.Implementations
crobibero57b1e93411a1
diff --git a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.csindex 6cb13cd23e..ced25524ee 100644--- a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs+++ b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs@@ -54,12 +54,17 @@ namespace Jellyfin.Server.Implementations.Usersvar 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);