Fixed test failure reported on CI

This commit is contained in:
AndyButland
2016-10-30 13:53:43 +01:00
parent 6560f38cb0
commit 8bb3685e5d
2 changed files with 4 additions and 1 deletions
+3 -1
View File
@@ -211,7 +211,9 @@ namespace Umbraco.Core.Services
/// <param name="icon">The application icon, which has to be located in umbraco/images/tray folder.</param>
public void MakeNew(string name, string alias, string icon)
{
MakeNew(name, alias, icon, GetSections().Max(x => x.SortOrder) + 1);
var sections = GetSections();
var nextSortOrder = sections != null ? GetSections().Max(x => x.SortOrder) + 1 : 1;
MakeNew(name, alias, icon, nextSortOrder);
}
/// <summary>
@@ -29,6 +29,7 @@ namespace Umbraco.Tests.Services
ServiceContext.SectionService.MakeNew("Settings", "settings", "icon-settings");
ServiceContext.SectionService.MakeNew("Developer", "developer", "icon-developer");
}
[Test]
public void SectionService_Can_Get_Allowed_Sections_For_User()
{