Check if content has an identity before attempting to get it's ancestors (#12733)
* Check if content has an identity before attempting to get it's ancestors * Check if we even need to go to the parent * Fail earlier * Update src/Umbraco.Web.BackOffice/Controllers/ContentController.cs Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com> Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
This commit is contained in:
committed by
Nikolaj Geisle
parent
aabb6c2665
commit
3baae5ab53
@@ -1797,6 +1797,11 @@ public class ContentController : ContentControllerBase
|
||||
|
||||
private IEnumerable<string> GetPublishedCulturesFromAncestors(IContent? content)
|
||||
{
|
||||
if (content?.ParentId is not -1 && content?.HasIdentity is false)
|
||||
{
|
||||
content = _contentService.GetById(content.ParentId);
|
||||
}
|
||||
|
||||
if (content?.ParentId == -1)
|
||||
{
|
||||
return content.PublishedCultures;
|
||||
|
||||
Reference in New Issue
Block a user