More work on nullable references
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Umbraco.Cms.Core.Models.Blocks
|
||||
/// not serialized, manually set and used during internally
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string? ContentTypeAlias { get; set; }
|
||||
public string ContentTypeAlias { get; set; } = string.Empty;
|
||||
|
||||
[JsonProperty("udi")]
|
||||
[JsonConverter(typeof(UdiJsonConverter))]
|
||||
@@ -49,13 +49,13 @@ namespace Umbraco.Cms.Core.Models.Blocks
|
||||
/// </summary>
|
||||
public class BlockPropertyValue
|
||||
{
|
||||
public BlockPropertyValue(object value, IPropertyType propertyType)
|
||||
public BlockPropertyValue(object? value, IPropertyType propertyType)
|
||||
{
|
||||
Value = value;
|
||||
PropertyType = propertyType ?? throw new ArgumentNullException(nameof(propertyType));
|
||||
}
|
||||
|
||||
public object Value { get; }
|
||||
public object? Value { get; }
|
||||
public IPropertyType PropertyType { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Umbraco.Cms.Core.Models
|
||||
throw new InvalidDataException($"The content item {entity.NodeId} has an invalid path: {entity.Path} with parentID: {entity.ParentId}");
|
||||
}
|
||||
|
||||
if (entity.ParentId != default(int) && pathParts[pathParts.Length - 2] != entity.ParentId.ToInvariantString())
|
||||
if (entity.ParentId != default(int) && pathParts[pathParts.Length - 2] != entity.ParentId?.ToInvariantString())
|
||||
{
|
||||
//the 2nd last id in the path must be it's parent id
|
||||
throw new InvalidDataException($"The content item {entity.NodeId} has an invalid path: {entity.Path} with parentID: {entity.ParentId}");
|
||||
|
||||
Reference in New Issue
Block a user