Skip to content

Commit

Permalink
Fix NRE warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist committed Jan 19, 2023
1 parent 1237f52 commit cb43033
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions samples/HaveIBeenPwned.WebApi/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ public void ConfigureServices(IServiceCollection services)
{
services.AddPwnedServices(options =>
{
options.ApiKey = _configuration["HibpOptions:ApiKey"];
options.UserAgent = _configuration["HibpOptions:UserAgent"];
options.ApiKey = _configuration["HibpOptions:ApiKey"]
?? throw new Exception("Missing required HibpOptions:ApiKey configuration value.");
options.UserAgent = _configuration["HibpOptions:UserAgent"]!;
});

services.AddControllers();
Expand Down

0 comments on commit cb43033

Please sign in to comment.