Make lots of models nullable
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Umbraco.Cms.Core.Models.Blocks
|
||||
/// <returns>
|
||||
/// The <see cref="BlockListItem" /> with the specified content key.
|
||||
/// </returns>
|
||||
public BlockListItem this[Guid contentKey] => this.FirstOrDefault(x => x.Content.Key == contentKey);
|
||||
public BlockListItem? this[Guid contentKey] => this.FirstOrDefault(x => x.Content.Key == contentKey);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="BlockListItem" /> with the specified content UDI.
|
||||
@@ -58,6 +58,6 @@ namespace Umbraco.Cms.Core.Models.Blocks
|
||||
/// <returns>
|
||||
/// The <see cref="BlockListItem" /> with the specified content UDI.
|
||||
/// </returns>
|
||||
public BlockListItem this[Udi contentUdi] => contentUdi is GuidUdi guidUdi ? this.FirstOrDefault(x => x.Content.Key == guidUdi.Guid) : null;
|
||||
public BlockListItem? this[Udi contentUdi] => contentUdi is GuidUdi guidUdi ? this.FirstOrDefault(x => x.Content.Key == guidUdi.Guid) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Umbraco.Cms.Core.Models.Blocks
|
||||
|
||||
public Udi SettingsUdi { get; }
|
||||
|
||||
public override bool Equals(object obj) => obj is ContentAndSettingsReference reference && Equals(reference);
|
||||
public override bool Equals(object? obj) => obj is ContentAndSettingsReference reference && Equals(reference);
|
||||
|
||||
public bool Equals(ContentAndSettingsReference other) => other != null
|
||||
&& EqualityComparer<Udi>.Default.Equals(ContentUdi, other.ContentUdi)
|
||||
|
||||
Reference in New Issue
Block a user