diff options
| author | crobibero <cody@robibe.ro> | 2020-11-13 08:32:24 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-11-13 08:32:24 -0700 |
| commit | 57b1e93411a19f1f6ea95131bdbeea4f9765df89 (patch) | |
| tree | 38702d1d6a990df50324f1f83ce0eb9f766985f8 | |
| parent | 38885ffd744e1b9d15fae80167ea67c94127acdd (diff) | |
Fix nullability errors in Jellyfin.Server.Implementations
| -rw-r--r-- | Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs index 6cb13cd23..ced25524e 100644 --- a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs +++ b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs @@ -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); |
