diff --git a/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs b/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs index f6a8166c9e..f9025883ef 100644 --- a/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs +++ b/src/Umbraco.Core/Strings/DefaultShortStringHelper.cs @@ -58,9 +58,14 @@ namespace Umbraco.Core.Strings static void InitializeLegacyUrlReplaceCharacters() { var replaceChars = UmbracoSettings.UrlReplaceCharacters; - foreach (var node in replaceChars.SelectNodes("char").Cast()) + if (replaceChars == null) return; + var nodes = replaceChars.SelectNodes("char"); + if (nodes == null) return; + foreach (var node in nodes.Cast()) { - var org = node.Attributes.GetNamedItem("org"); + var attributes = node.Attributes; + if (attributes == null) continue; + var org = attributes.GetNamedItem("org"); if (org != null && org.Value != "") UrlReplaceCharacters[org.Value] = XmlHelper.GetNodeValue(node); }