Merge pull request #2921 from abpframework/maliming/scope

Fix scopes may be null bug.
pull/2948/head
Halil İbrahim Kalkan 6 years ago committed by GitHub
commit f730633131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,4 @@
@page
@page
@using Volo.Abp.Account.Web.Pages
@using Volo.Abp.Account.Web.Pages.Account
@model ConsentModel
@ -25,7 +25,7 @@
<div>Uncheck the permissions you do not wish to grant.</div>
@if (Model.ConsentInput.IdentityScopes.Any())
@if (!Model.ConsentInput.IdentityScopes.IsNullOrEmpty())
{
<h3>Personal Information</h3>
@ -55,7 +55,7 @@
</ul>
}
@if (Model.ConsentInput.ApiScopes.Any())
@if (!Model.ConsentInput.ApiScopes.IsNullOrEmpty())
{
<h3>Application Access</h3>

@ -106,7 +106,7 @@ namespace Volo.Abp.Account.Web.Pages
}
else
{
if (ConsentInput.IdentityScopes.Any() || ConsentInput.ApiScopes.Any())
if (!ConsentInput.IdentityScopes.IsNullOrEmpty() || !ConsentInput.ApiScopes.IsNullOrEmpty())
{
grantedConsent = new ConsentResponse
{
@ -187,7 +187,9 @@ namespace Volo.Abp.Account.Web.Pages
public List<string> GetAllowedScopeNames()
{
return IdentityScopes.Union(ApiScopes).Where(s => s.Checked).Select(s => s.Name).ToList();
var identityScopes = IdentityScopes ?? new List<ConsentModel.ScopeViewModel>();
var apiScopes = IdentityScopes ?? new List<ConsentModel.ScopeViewModel>();
return identityScopes.Union(apiScopes).Where(s => s.Checked).Select(s => s.Name).ToList();
}
}

Loading…
Cancel
Save