aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-11-13 08:32:24 -0700
committercrobibero <cody@robibe.ro>2020-11-13 08:32:24 -0700
commit57b1e93411a19f1f6ea95131bdbeea4f9765df89 (patch)
tree38702d1d6a990df50324f1f83ce0eb9f766985f8 /Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs
parent38885ffd744e1b9d15fae80167ea67c94127acdd (diff)
Fix nullability errors in Jellyfin.Server.Implementations
Diffstat (limited to 'Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs')
-rw-r--r--Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs7
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);