From 8c39f9ce815f5436409e43bb105d4ec93f1ec9ab Mon Sep 17 00:00:00 2001 From: rootdarkarchon Date: Wed, 11 Jan 2023 23:05:00 +0100 Subject: [PATCH] fix null in AuthorizeAsync --- .../Authentication/SecretKeyAuthenticatorService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MareSynchronosServer/MareSynchronosServer/Authentication/SecretKeyAuthenticatorService.cs b/MareSynchronosServer/MareSynchronosServer/Authentication/SecretKeyAuthenticatorService.cs index 40c80e8..b9a0144 100644 --- a/MareSynchronosServer/MareSynchronosServer/Authentication/SecretKeyAuthenticatorService.cs +++ b/MareSynchronosServer/MareSynchronosServer/Authentication/SecretKeyAuthenticatorService.cs @@ -57,7 +57,7 @@ public class SecretKeyAuthenticatorService using var context = scope.ServiceProvider.GetService(); var authReply = await context.Auth.AsNoTracking().SingleOrDefaultAsync(u => u.HashedKey == hashedSecretKey).ConfigureAwait(false); - SecretKeyAuthReply reply = new(authReply != null, authReply?.UserUID, false, authReply.IsBanned); + SecretKeyAuthReply reply = new(authReply != null, authReply?.UserUID, false, authReply?.IsBanned ?? false); if (reply.Success) {