U4-10957 If RequiredSection is not defined in a tour - backoffice will throw errors

This commit is contained in:
Claus
2018-02-09 11:55:34 +01:00
parent 3097a46ab3
commit b2004057a5
+11 -5
View File
@@ -70,14 +70,20 @@ namespace Umbraco.Web.Editors
//Checking to see if the user has access to the required tour sections, else we remove the tour
foreach (var backOfficeTourFile in result)
{
foreach (var tour in backOfficeTourFile.Tours)
if (backOfficeTourFile.Tours != null)
{
foreach (var toursRequiredSection in tour.RequiredSections)
foreach (var tour in backOfficeTourFile.Tours)
{
if (allowedSections.Contains(toursRequiredSection) == false)
if (tour.RequiredSections != null)
{
toursToBeRemoved.Add(backOfficeTourFile);
break;
foreach (var toursRequiredSection in tour.RequiredSections)
{
if (allowedSections.Contains(toursRequiredSection) == false)
{
toursToBeRemoved.Add(backOfficeTourFile);
break;
}
}
}
}
}