diff --git a/osu.Server.Queues.ScoreStatisticsProcessor/Commands/Queue/BatchInserter.cs b/osu.Server.Queues.ScoreStatisticsProcessor/Commands/Queue/BatchInserter.cs index e506faf4..7d3ab706 100644 --- a/osu.Server.Queues.ScoreStatisticsProcessor/Commands/Queue/BatchInserter.cs +++ b/osu.Server.Queues.ScoreStatisticsProcessor/Commands/Queue/BatchInserter.cs @@ -468,10 +468,17 @@ private async Task enqueueForFurtherProcessing(ulong firstId, ulong lastId, MySq // on completion of PP processing, the score will be pushed to ES for indexing. // the score refetch here is wasteful, but convenient and reliable, as the actual updated/inserted `SoloScore` row // is not constructed anywhere before this... - var score = await connection.QuerySingleAsync("SELECT * FROM `scores` WHERE `id` = @id", - new { id = scoreId }); - var history = await connection.QuerySingleOrDefaultAsync("SELECT * FROM `score_process_history` WHERE `score_id` = @id", + var score = await connection.QuerySingleOrDefaultAsync("SELECT * FROM `scores` WHERE `id` = @id", new { id = scoreId }); + + if (score == null) + { + // likely a deletion; already queued for ES above. + continue; + } + + var history = await connection.QuerySingleOrDefaultAsync("SELECT * FROM `score_process_history` WHERE `score_id` = @id", new { id = scoreId }); + ScoreStatisticsItems.Add(new ScoreItem(score, history)); } }