Mark `Converts` as nullable

This commit is contained in:
Joseph Madamba 2023-01-15 12:46:41 -08:00
parent e7ab543799
commit 85c1932851
2 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ public string AuthorString
public APIBeatmap[] Beatmaps { get; set; } = Array.Empty<APIBeatmap>();
[JsonProperty(@"converts")]
public APIBeatmap[] Converts { get; set; } = Array.Empty<APIBeatmap>();
public APIBeatmap[]? Converts { get; set; }
private BeatmapMetadata metadata => new BeatmapMetadata
{

View File

@ -168,7 +168,7 @@ private void updateDisplay()
if (BeatmapSet != null)
{
Difficulties.ChildrenEnumerable = BeatmapSet.Beatmaps.Concat(BeatmapSet.Converts)
Difficulties.ChildrenEnumerable = BeatmapSet.Beatmaps.Concat(BeatmapSet.Converts ?? Array.Empty<APIBeatmap>())
.Where(b => b.Ruleset.MatchesOnlineID(ruleset.Value))
.OrderBy(b => !b.Convert)
.ThenBy(b => b.StarRating)