Check for null in OptionsFactory (#41047)
authorTaylor Southwick <tasou@microsoft.com>
Tue, 29 Sep 2020 20:59:26 +0000 (13:59 -0700)
committerGitHub <noreply@github.com>
Tue, 29 Sep 2020 20:59:26 +0000 (13:59 -0700)
commitf4094bfaaa7e2fa3fd5b765949adb464a9bd4d73
treeb19a1dd80e3f40a93b18466d36614dc3a768b354
parent03347e0567bb0d13f5173071478a824c880bf533
Check for null in OptionsFactory (#41047)

If an IValidateOptions<TOptions> returns null, then an error occurs that can be difficult to track down. This change checks for null before checking if it failed.
src/libraries/Microsoft.Extensions.Options/src/OptionsFactory.cs
src/libraries/Microsoft.Extensions.Options/tests/Microsoft.Extensions.Options.Tests/OptionsFactoryTests.cs