diff --git a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
index 9c37bb103b..db47ba599f 100644
--- a/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
+++ b/src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
@@ -836,6 +836,11 @@ public class MediaController : ContentControllerBase
continue;
}
+ if (allowedContentTypes.Any(x => x.Alias == mediaTypeItem.Alias) == false)
+ {
+ continue;
+ }
+
mediaTypeAlias = mediaTypeItem.Alias;
break;
}
@@ -973,7 +978,6 @@ public class MediaController : ContentControllerBase
///
private async Task?> GetParentIdAsIntAsync(string? parentId, bool validatePermissions)
{
-
// test for udi
if (UdiParser.TryParse(parentId, out GuidUdi? parentUdi))
{
@@ -1183,7 +1187,7 @@ public class MediaController : ContentControllerBase
var pagedResult = new PagedResult>(totalChildren, pageNumber, pageSize)
{
Items = children
- .Select(_umbracoMapper.Map>).WhereNotNull()
+ .Select(_umbracoMapper.Map>).WhereNotNull()
};
return pagedResult;