Browse Source

Update ConsentController.cs

Possible null ref in line 65
pull/1120/head
el-titan 5 years ago
committed by GitHub
parent
commit
1b67ad8e87
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Services/Identity/Identity.API/Controllers/ConsentController.cs

+ 3
- 3
src/Services/Identity/Identity.API/Controllers/ConsentController.cs View File

@ -62,12 +62,12 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
ConsentResponse response = null;
// user clicked 'no' - send back the standard 'access_denied' response
if (model.Button == "no")
if (model != null && model.Button == "no")
{
response = ConsentResponse.Denied;
}
// user clicked 'yes' - validate the data
else if (model.Button == "yes" && model != null)
else if (model != null && model.Button == "yes")
{
// if the user consented to some scope, build the response model
if (model.ScopesConsented != null && model.ScopesConsented.Any())
@ -137,4 +137,4 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
return null;
}
}
}
}

Loading…
Cancel
Save