From c7b05d545505308341f27b0a1f78e6ac258966cf Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 8 Jan 2025 10:42:08 +0100 Subject: [PATCH] Fixed infinite loop triggered when requesting media by ID in a folder via the media delivery API. (#17876) --- .../DeliveryApi/ApiMediaWithCropsResponseBuilder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/DeliveryApi/ApiMediaWithCropsResponseBuilder.cs b/src/Umbraco.Infrastructure/DeliveryApi/ApiMediaWithCropsResponseBuilder.cs index 98443bd8cc..6c7480129a 100644 --- a/src/Umbraco.Infrastructure/DeliveryApi/ApiMediaWithCropsResponseBuilder.cs +++ b/src/Umbraco.Infrastructure/DeliveryApi/ApiMediaWithCropsResponseBuilder.cs @@ -1,4 +1,4 @@ -using Umbraco.Cms.Core.DeliveryApi; +using Umbraco.Cms.Core.DeliveryApi; using Umbraco.Cms.Core.Models.DeliveryApi; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.PublishedCache; @@ -38,7 +38,7 @@ internal sealed class ApiMediaWithCropsResponseBuilder : ApiMediaWithCropsBuilde while (current != null) { yield return current.Name.ToLowerInvariant(); - current = GetParent(media); + current = GetParent(current); } }