From 8e122c5ad768da772c89d0dcd16626c9424c0471 Mon Sep 17 00:00:00 2001 From: dhcpcd Date: Thu, 2 Jun 2022 01:30:22 +0300 Subject: [PATCH] Probably fixed NFE in scores. --- OsuLazerServer/Database/Tables/Scores/Score.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OsuLazerServer/Database/Tables/Scores/Score.cs b/OsuLazerServer/Database/Tables/Scores/Score.cs index 2c244f6..05bf07f 100644 --- a/OsuLazerServer/Database/Tables/Scores/Score.cs +++ b/OsuLazerServer/Database/Tables/Scores/Score.cs @@ -62,12 +62,12 @@ public class DbScore public async Task ToOsuScore(IBeatmapSetResolver? resolver = null) { var ctx = new LazerContext(); - var beatmap = resolver is not null ? (await resolver.FetchBeatmap(BeatmapId)) : null; + var beatmap = resolver is not null ? await resolver.FetchBeatmap(BeatmapId) : null; return new APIScore { Accuracy = Accuracy, - Beatmap = beatmap is not null ? await beatmap?.ToOsu() : null, - beatmapSet = resolver is not null ? (await resolver.FetchSetAsync(beatmap.BeatmapsetId)).ToBeatmapSet() : null, + Beatmap = beatmap is not null && beatmap is not null ? await beatmap.ToOsu() : null, + beatmapSet = resolver is not null && beatmap is not null ? (await resolver.FetchSetAsync(beatmap.BeatmapsetId))?.ToBeatmapSet() : null, Date = SubmittedAt, Rank = ModeUtils.CalculateRank(this), Statistics = HitResultStats.FromJson(Statistics).ToOsu(), -- GitLab