mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 12:03:21 +08:00
Merge pull request #1254 from peppy/fix-beatmapinfo-comparator
Fix BeatmapInfo's comparator when not being sourced from database
This commit is contained in:
commit
ea9d10976b
@ -100,6 +100,11 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public bool Equals(BeatmapInfo other)
|
public bool Equals(BeatmapInfo other)
|
||||||
{
|
{
|
||||||
|
if (ID == 0 || other?.ID == 0)
|
||||||
|
// one of the two BeatmapInfos we are comparing isn't sourced from a database.
|
||||||
|
// fall back to reference equality.
|
||||||
|
return ReferenceEquals(this, other);
|
||||||
|
|
||||||
return ID == other?.ID;
|
return ID == other?.ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user