From 362913db3c1bfc039a8dc186e64fa406f20a92c2 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 2 Nov 2024 13:09:57 -0400 Subject: [PATCH] Fix null reference exceptions --- .../Security/OAuth/GenericOAuthValidator.cs | 2 +- .../Security/OAuth/GitHubOAuthValidator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs b/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs index d14c461a4d..8c0d1b8b02 100644 --- a/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs +++ b/src/Tgstation.Server.Host/Security/OAuth/GenericOAuthValidator.cs @@ -28,7 +28,7 @@ abstract class GenericOAuthValidator : IOAuthValidator public abstract OAuthProvider Provider { get; } /// - public OAuthGatewayStatus GatewayStatus => OAuthConfiguration.Gateway!.Value; + public OAuthGatewayStatus GatewayStatus => OAuthConfiguration.Gateway ?? OAuthGatewayStatus.Disabled; /// /// The for the . diff --git a/src/Tgstation.Server.Host/Security/OAuth/GitHubOAuthValidator.cs b/src/Tgstation.Server.Host/Security/OAuth/GitHubOAuthValidator.cs index e07ff4b7ed..5a967912b9 100644 --- a/src/Tgstation.Server.Host/Security/OAuth/GitHubOAuthValidator.cs +++ b/src/Tgstation.Server.Host/Security/OAuth/GitHubOAuthValidator.cs @@ -22,7 +22,7 @@ sealed class GitHubOAuthValidator : IOAuthValidator public OAuthProvider Provider => OAuthProvider.GitHub; /// - public OAuthGatewayStatus GatewayStatus => oAuthConfiguration.Gateway!.Value; + public OAuthGatewayStatus GatewayStatus => oAuthConfiguration.Gateway ?? OAuthGatewayStatus.Disabled; /// /// The for the .