diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/CanonicalHelperModel.ascx b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/CanonicalHelperModel.ascx index a1e506ca..bf437d08 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/CanonicalHelperModel.ascx +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/CanonicalHelperModel.ascx @@ -2,6 +2,6 @@ <%@ Import Namespace="System.Web.Mvc.Html" %> <%@ Import Namespace="MvcSiteMapProvider.Web.Html.Models" %> -<% if (!String.IsNullOrEmpty(Model.CurrentNode.CanonicalUrl)) { %> +<% if (Model.CurrentNode != null && !String.IsNullOrEmpty(Model.CurrentNode.CanonicalUrl)) { %> <% } %> \ No newline at end of file diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/CanonicalHelperModel.cshtml b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/CanonicalHelperModel.cshtml index 24075c4d..ea50cd1b 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/CanonicalHelperModel.cshtml +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/CanonicalHelperModel.cshtml @@ -2,6 +2,6 @@ @using System.Web.Mvc.Html @using MvcSiteMapProvider.Web.Html.Models -@if (!String.IsNullOrEmpty(Model.CurrentNode.CanonicalUrl)) { +@if (Model.CurrentNode != null && !String.IsNullOrEmpty(Model.CurrentNode.CanonicalUrl)) { } \ No newline at end of file diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/MetaRobotsHelperModel.ascx b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/MetaRobotsHelperModel.ascx index 9a1667a1..d8b89d3c 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/MetaRobotsHelperModel.ascx +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/MetaRobotsHelperModel.ascx @@ -2,6 +2,6 @@ <%@ Import Namespace="System.Web.Mvc.Html" %> <%@ Import Namespace="MvcSiteMapProvider.Web.Html.Models" %> -<% if (!String.IsNullOrEmpty(Model.CurrentNode.MetaRobotsContent)) { %> +<% if (Model.CurrentNode != null && !String.IsNullOrEmpty(Model.CurrentNode.MetaRobotsContent)) { %> <% } %> \ No newline at end of file diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/MetaRobotsHelperModel.cshtml b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/MetaRobotsHelperModel.cshtml index 2b98b07a..60089ec1 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/MetaRobotsHelperModel.cshtml +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/MetaRobotsHelperModel.cshtml @@ -2,6 +2,6 @@ @using System.Web.Mvc.Html @using MvcSiteMapProvider.Web.Html.Models -@if (!String.IsNullOrEmpty(Model.CurrentNode.MetaRobotsContent)) { +@if (Model.CurrentNode != null && !String.IsNullOrEmpty(Model.CurrentNode.MetaRobotsContent)) { } \ No newline at end of file diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/SiteMapTitleHelperModel.ascx b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/SiteMapTitleHelperModel.ascx index ef78c28c..0dbdcefb 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/SiteMapTitleHelperModel.ascx +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/SiteMapTitleHelperModel.ascx @@ -2,4 +2,6 @@ <%@ Import Namespace="System.Web.Mvc.Html" %> <%@ Import Namespace="MvcSiteMapProvider.Web.Html.Models" %> -<%=Model.CurrentNode.Title%> \ No newline at end of file +<% if (Model.CurrentNode != null) { %> +<%=Model.CurrentNode.Title%> +<% } %> \ No newline at end of file diff --git a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/SiteMapTitleHelperModel.cshtml b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/SiteMapTitleHelperModel.cshtml index 5fd203bf..39fd1c76 100644 --- a/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/SiteMapTitleHelperModel.cshtml +++ b/src/MvcSiteMapProvider/MvcSiteMapProvider/Web/Html/DisplayTemplates/SiteMapTitleHelperModel.cshtml @@ -2,4 +2,4 @@ @using System.Web.Mvc.Html @using MvcSiteMapProvider.Web.Html.Models -@Model.CurrentNode.Title \ No newline at end of file +@if (Model.CurrentNode != null) {Model.CurrentNode.Title;} \ No newline at end of file