diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs index 57474eb2e1ec..be8b0619f5b5 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs @@ -18,7 +18,7 @@ public virtual bool IsConverter(IPublishedPropertyType propertyType) case PropertyValueLevel.Source: // the default implementation uses the old magic null & string comparisons, // other implementations may be more clever, and/or test the final converted object values - return value != null && (!(value is string) || string.IsNullOrWhiteSpace((string)value) == false); + return value != null && (!(value is string stringValue) || !string.IsNullOrWhiteSpace(stringValue)); case PropertyValueLevel.Inter: return null; case PropertyValueLevel.Object: @@ -32,7 +32,7 @@ public virtual bool IsConverter(IPublishedPropertyType propertyType) public virtual bool HasValue(IPublishedProperty property, string culture, string segment) { var value = property.GetSourceValue(culture, segment); - return value != null && (!(value is string) || string.IsNullOrWhiteSpace((string)value) == false); + return value != null && (!(value is string stringValue) || !string.IsNullOrWhiteSpace(stringValue)); } public virtual Type GetPropertyValueType(IPublishedPropertyType propertyType)