Fixed possible null reference exceptions
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.BackOffice.Filters;
|
||||
using Umbraco.Web.Common.Attributes;
|
||||
using Umbraco.Web.Common.Authorization;
|
||||
using Umbraco.Web.Models.Trees;
|
||||
@@ -38,9 +38,15 @@ namespace Umbraco.Web.BackOffice.Trees
|
||||
.Select(dt => CreateTreeNode(dt.Id.ToString(), id, queryStrings, dt.Name, Constants.Icons.MemberGroup, false));
|
||||
}
|
||||
|
||||
protected override TreeNode CreateRootNode(FormCollection queryStrings)
|
||||
protected override ActionResult<TreeNode> CreateRootNode(FormCollection queryStrings)
|
||||
{
|
||||
var root = base.CreateRootNode(queryStrings);
|
||||
var rootResult = base.CreateRootNode(queryStrings);
|
||||
if (!(rootResult.Result is null))
|
||||
{
|
||||
return rootResult;
|
||||
}
|
||||
var root = rootResult.Value;
|
||||
|
||||
//check if there are any groups
|
||||
root.HasChildren = _memberGroupService.GetAll().Any();
|
||||
return root;
|
||||
|
||||
Reference in New Issue
Block a user