Skip to content

Commit

Permalink
Check Jwt-related configuration is null
Browse files Browse the repository at this point in the history
  • Loading branch information
moreal committed Sep 10, 2024
1 parent e752b3b commit fe0bdf1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public StandaloneSubscription(StandaloneContext standaloneContext, IConfiguratio
{
StandaloneContext = standaloneContext;
Configuration = configuration;
if (Convert.ToBoolean(configuration.GetSection("Jwt")["EnableJwtAuthentication"]))
if (configuration.GetSection("Jwt")["EnableJwtAuthentication"] is { } enableJwtAuthentication && Convert.ToBoolean(enableJwtAuthentication))
{
this.AuthorizeWith(GraphQLService.JwtPolicyKey);
}
Expand Down

0 comments on commit fe0bdf1

Please sign in to comment.