Implemented an extension method to lessen duplication of code

This commit is contained in:
Zeegaan
2021-08-16 10:31:11 +02:00
parent 1906228ead
commit cca7c379ae
17 changed files with 46 additions and 106 deletions

View File

@@ -624,10 +624,7 @@ namespace Umbraco.Cms.Core.Security
{
return null;
}
if (_publishedSnapshotAccessor.TryGetPublishedSnapshot(out var publishedSnapshot))
{
throw new InvalidOperationException("Wasn't possible to a get a valid Snapshot");
}
var publishedSnapshot = _publishedSnapshotAccessor.GetRequiredPublishedSnapshot();
return publishedSnapshot.Members.Get(member);
}