Don't attempt to apply a filter if none is submitted

This commit is contained in:
Kenn Jacobsen
2019-01-02 20:57:18 +01:00
committed by Sebastiaan Janssen
parent 17d818b604
commit 2dfbb1d555

View File

@@ -479,7 +479,9 @@ namespace Umbraco.Web.Editors
if (objectType.HasValue)
{
var entities = Services.EntityService.GetPagedChildren(id, objectType.Value, pageNumber - 1, pageSize, out var totalRecords,
SqlContext.Query<IUmbracoEntity>().Where(x => x.Name.Contains(filter)),
filter.IsNullOrWhiteSpace()
? null
: SqlContext.Query<IUmbracoEntity>().Where(x => x.Name.Contains(filter)),
Ordering.By(orderBy, orderDirection));
if (totalRecords == 0)