diff --git a/samples/UmbracoV9/Views/Shared/_Layout.cshtml b/samples/UmbracoV9/Views/Shared/_Layout.cshtml index 4c5463b..9a655c0 100644 --- a/samples/UmbracoV9/Views/Shared/_Layout.cshtml +++ b/samples/UmbracoV9/Views/Shared/_Layout.cshtml @@ -7,12 +7,21 @@ @inject IRelewiseClientFactory RelewiseClientFactory; @{ - var breadcrumb = Model.Breadcrumbs(andSelf: true).ToArray(); - var homePage = breadcrumb.First(); + IPublishedContent[] breadcrumb = Model.Breadcrumbs(andSelf: true).ToArray(); + IPublishedContent homePage = breadcrumb.First(); IEnumerable footer = homePage.Value>("footerLinks").EmptyIfNull(); IEnumerable headerLinks = homePage.Value>("headerLinks").EmptyIfNull(); - RelewiseClientOptions tracker = RelewiseClientFactory.GetOptions("Browser"); + RelewiseClientOptions tracker = null; + try + { + tracker = RelewiseClientFactory.GetOptions("Browser"); + } + catch (ArgumentException) + { + // Client not found - ignore error + // Note: this will be replaced by a call to a future Contains()-method on the client factory. + } } @@ -45,9 +54,12 @@ - + @if (tracker != null) + { + + }