Fail fast if authenticator key is null (#14037)

This commit is contained in:
Hao Kung 2019-10-21 10:05:22 -07:00 committed by GitHub
parent 4fd9d383d9
commit fe62ce7ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Identity
{
var key = await manager.GetAuthenticatorKeyAsync(user);
int code;
if (!int.TryParse(token, out code))
if (key == null || !int.TryParse(token, out code))
{
return false;
}