Ensure query is not null before using Trim()

This commit is contained in:
Bjarne Fyrstenborg
2022-01-02 20:19:25 +01:00
committed by Sebastiaan Janssen
parent c3b619fbbf
commit 6a95ff366f

View File

@@ -64,7 +64,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers
public ActionResult<SearchResults> GetSearchResults(string searcherName, string query, int pageIndex = 0, int pageSize = 20)
{
query = query.Trim();
query = query?.Trim();
if (query.IsNullOrWhiteSpace())
{