diff --git a/src/Umbraco.Core/Extensions/StringExtensions.cs b/src/Umbraco.Core/Extensions/StringExtensions.cs index a2be76e109..90a06fced5 100644 --- a/src/Umbraco.Core/Extensions/StringExtensions.cs +++ b/src/Umbraco.Core/Extensions/StringExtensions.cs @@ -1252,9 +1252,9 @@ namespace Umbraco.Extensions /// The text to filter. /// The short string helper. /// The safe alias. - public static string ToSafeAlias(this string alias, IShortStringHelper shortStringHelper) + public static string ToSafeAlias(this string alias, IShortStringHelper? shortStringHelper) { - return shortStringHelper.CleanStringForSafeAlias(alias); + return shortStringHelper?.CleanStringForSafeAlias(alias) ?? string.Empty; } /// diff --git a/src/Umbraco.Core/PropertyEditors/DataValueEditorFactory.cs b/src/Umbraco.Core/PropertyEditors/DataValueEditorFactory.cs index 1f717d9065..300bdde672 100644 --- a/src/Umbraco.Core/PropertyEditors/DataValueEditorFactory.cs +++ b/src/Umbraco.Core/PropertyEditors/DataValueEditorFactory.cs @@ -10,9 +10,9 @@ namespace Umbraco.Cms.Core.PropertyEditors public DataValueEditorFactory(IServiceProvider serviceProvider) => _serviceProvider = serviceProvider; - public TDataValueEditor Create(params object?[] args) + public TDataValueEditor Create(params object[] args) where TDataValueEditor: class, IDataValueEditor - => _serviceProvider.CreateInstance(args.WhereNotNull()); + => _serviceProvider.CreateInstance(args); } } diff --git a/src/Umbraco.Core/PropertyEditors/IDataValueEditorFactory.cs b/src/Umbraco.Core/PropertyEditors/IDataValueEditorFactory.cs index 4a80d28ae0..663c7db6d6 100644 --- a/src/Umbraco.Core/PropertyEditors/IDataValueEditorFactory.cs +++ b/src/Umbraco.Core/PropertyEditors/IDataValueEditorFactory.cs @@ -5,7 +5,7 @@ namespace Umbraco.Cms.Core.PropertyEditors { public interface IDataValueEditorFactory { - TDataValueEditor Create(params object?[] args) + TDataValueEditor Create(params object[] args) where TDataValueEditor : class, IDataValueEditor; } }