Merge pull request #13497 from smoogipoo/fix-present-score

Make PresentScore() use replay hash as fallback
This commit is contained in:
Dean Herbert 2021-06-16 15:18:01 +09:00 committed by GitHub
commit f802679d38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -426,9 +426,12 @@ public void PresentScore(ScoreInfo score, ScorePresentType presentType = ScorePr
{
// The given ScoreInfo may have missing properties if it was retrieved from online data. Re-retrieve it from the database
// to ensure all the required data for presenting a replay are present.
var databasedScoreInfo = score.OnlineScoreID != null
? ScoreManager.Query(s => s.OnlineScoreID == score.OnlineScoreID)
: ScoreManager.Query(s => s.Hash == score.Hash);
ScoreInfo databasedScoreInfo = null;
if (score.OnlineScoreID != null)
databasedScoreInfo = ScoreManager.Query(s => s.OnlineScoreID == score.OnlineScoreID);
databasedScoreInfo ??= ScoreManager.Query(s => s.Hash == score.Hash);
if (databasedScoreInfo == null)
{