diff --git a/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs b/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs index c043161486..90c4307807 100644 --- a/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs +++ b/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs @@ -89,10 +89,10 @@ public sealed class HtmlStringUtilities return sb.ToString(); } - public string Coalesce(params object[] args) + public string Coalesce(params object?[] args) { var arg = args - .Select(x => x.ToString()) + .Select(x => x?.ToString()) .FirstOrDefault(x => string.IsNullOrWhiteSpace(x) == false); return arg ?? string.Empty; diff --git a/src/Umbraco.Web.Website/Extensions/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web.Website/Extensions/HtmlHelperRenderExtensions.cs index 0f30a1dcd5..13a606b28b 100644 --- a/src/Umbraco.Web.Website/Extensions/HtmlHelperRenderExtensions.cs +++ b/src/Umbraco.Web.Website/Extensions/HtmlHelperRenderExtensions.cs @@ -910,7 +910,7 @@ public static class HtmlHelperRenderExtensions /// /// Will take the first non-null value in the collection and return the value of it. /// - public static string Coalesce(this IHtmlHelper helper, params object[] args) + public static string Coalesce(this IHtmlHelper helper, params object?[] args) => s_stringUtilities.Coalesce(args); ///