From d845bd68bc927de7c0efa341f2b78194aaf51553 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle Date: Mon, 28 Feb 2022 14:13:21 +0100 Subject: [PATCH] Fix more errors --- src/Umbraco.Core/Extensions/StringExtensions.cs | 4 ++-- src/Umbraco.Core/PropertyEditors/DataValueEditorFactory.cs | 4 ++-- src/Umbraco.Core/PropertyEditors/IDataValueEditorFactory.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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; } }