diff --git a/src/Umbraco.Web/PublishedCache/UmbracoContextPublishedSnapshotAccessor.cs b/src/Umbraco.Web/PublishedCache/UmbracoContextPublishedSnapshotAccessor.cs index 706d67020a..76936dd2cb 100644 --- a/src/Umbraco.Web/PublishedCache/UmbracoContextPublishedSnapshotAccessor.cs +++ b/src/Umbraco.Web/PublishedCache/UmbracoContextPublishedSnapshotAccessor.cs @@ -16,14 +16,10 @@ namespace Umbraco.Web.PublishedCache get { var umbracoContext = _umbracoContextAccessor.UmbracoContext; - if (umbracoContext == null) throw new Exception("The IUmbracoContextAccessor could not provide an UmbracoContext."); - return umbracoContext.PublishedSnapshot; + return umbracoContext?.PublishedSnapshot; } - set - { - throw new NotSupportedException(); // not ok to set - } + set => throw new NotSupportedException(); // not ok to set } } }