Added a null check to IUmbracoHelperAccessor & IPublishedSnapshotAccessor

This commit is contained in:
Zeegaan
2021-08-10 10:55:29 +02:00
parent 3eb32a97a7
commit 5d264fefdb
28 changed files with 173 additions and 66 deletions

View File

@@ -117,7 +117,7 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache
_publishedModelFactory = publishedModelFactory;
}
protected PublishedSnapshot CurrentPublishedSnapshot => (PublishedSnapshot)_publishedSnapshotAccessor.PublishedSnapshot;
protected PublishedSnapshot CurrentPublishedSnapshot { get { _publishedSnapshotAccessor.TryGetPublishedSnapshot(out var publishedSnapshot); return (PublishedSnapshot)publishedSnapshot; } }
// NOTE: These aren't used within this object but are made available internally to improve the IdKey lookup performance
// when nucache is enabled.