Fixes: U4-3051 GetAncestorOrSelfDocuments gets stuck in infinite loop
This commit is contained in:
@@ -33,7 +33,7 @@ namespace umbraco
|
||||
public static IEnumerable<Document> GetAncestorDocuments(this Document document)
|
||||
{
|
||||
var ancestor = uQuery.GetDocument(document.ParentId);
|
||||
while (ancestor != null)
|
||||
while (ancestor != null && ancestor.Id != -1)
|
||||
{
|
||||
yield return ancestor;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace umbraco
|
||||
{
|
||||
var ancestor = new Media(media.Parent.Id);
|
||||
|
||||
while (ancestor != null)
|
||||
while (ancestor != null && ancestor.Id != -1)
|
||||
{
|
||||
yield return ancestor;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user