From b2004057a50382e4ab45e3dcc2e851256d4fcf4d Mon Sep 17 00:00:00 2001 From: Claus Date: Fri, 9 Feb 2018 11:55:34 +0100 Subject: [PATCH] U4-10957 If RequiredSection is not defined in a tour - backoffice will throw errors --- src/Umbraco.Web/Editors/TourController.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web/Editors/TourController.cs b/src/Umbraco.Web/Editors/TourController.cs index da16659cfe..98a01f2c6e 100644 --- a/src/Umbraco.Web/Editors/TourController.cs +++ b/src/Umbraco.Web/Editors/TourController.cs @@ -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; + } + } } } }