1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 06:35:05 +08:00

Merge pull request #16677 from peppy/fix-incorrect-null-null-equality

Fix a couple of cases of incorrect equality checks in the case both values are null
This commit is contained in:
Dan Balasescu 2022-01-28 15:41:09 +09:00 committed by GitHub
commit ea716194e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -107,6 +107,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{ {
set set
{ {
if (score == null && value == null)
return;
if (score?.Equals(value) == true) if (score?.Equals(value) == true)
return; return;

View File

@ -38,6 +38,14 @@ namespace osu.Game.Screens.Select.Leaderboards
get => beatmapInfo; get => beatmapInfo;
set set
{ {
if (beatmapInfo == null && value == null)
{
// always null scores to ensure a correct initial display.
// see weird `scoresLoadedOnce` logic in base implementation.
Scores = null;
return;
}
if (beatmapInfo?.Equals(value) == true) if (beatmapInfo?.Equals(value) == true)
return; return;