Fix BeatmapInfo's comparator when not being sourced from database

This commit is contained in:
Dean Herbert 2017-09-13 10:29:09 +09:00
parent 452506d982
commit 1de1b882e3

View File

@ -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;
} }