Skip to content

Commit

Permalink
Do not attempt to match score by equality of hash if it's empty
Browse files Browse the repository at this point in the history
Closes ppy#28216.

The affected user's database contained six sentakki scores with an empty
hash. When an online score is being imported, an online model (which
does not have a hash) will be transmogrified into a `ScoreInfo` with
an empty hash, which would end up accidentally matching those scores
and basically breaking everything at that point.

To fix, avoid attempting to match anything on empty hash. This does not
break online score matching because for those cases the actual online ID
of the score will be used.
  • Loading branch information
bdach committed May 20, 2024
1 parent 78ed9e2 commit 94b14f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion osu.Game/Scoring/ScoreManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public ScoreManager(RulesetStore rulesets, Func<BeatmapManager> beatmaps, Storag
{
ScoreInfo? databasedScoreInfo = null;

if (originalScoreInfo is ScoreInfo scoreInfo)
if (originalScoreInfo is ScoreInfo scoreInfo && !string.IsNullOrEmpty(scoreInfo.Hash))
databasedScoreInfo = Query(s => s.Hash == scoreInfo.Hash);

if (originalScoreInfo.OnlineID > 0)
Expand Down

0 comments on commit 94b14f6

Please sign in to comment.