From 1de1b882e30653438c155add1222860ec2134a20 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 13 Sep 2017 10:29:09 +0900 Subject: [PATCH] Fix BeatmapInfo's comparator when not being sourced from database --- osu.Game/Beatmaps/BeatmapInfo.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/osu.Game/Beatmaps/BeatmapInfo.cs b/osu.Game/Beatmaps/BeatmapInfo.cs index c962201fe3..0776669811 100644 --- a/osu.Game/Beatmaps/BeatmapInfo.cs +++ b/osu.Game/Beatmaps/BeatmapInfo.cs @@ -100,6 +100,11 @@ namespace osu.Game.Beatmaps 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; }