From 814b520e5e7bc41a99adbc927b7021f4c6741a6d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 27 Oct 2019 11:35:45 +0900 Subject: [PATCH] Avoid potential mis-cast in comparison --- osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index 26f7209be6..a5a4380d4a 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -204,8 +204,8 @@ public override HitSampleInfo ApplyTo(HitSampleInfo hitSampleInfo) } public override bool EquivalentTo(ControlPoint other) => - base.EquivalentTo(other) - && CustomSampleBank == ((LegacySampleControlPoint)other).CustomSampleBank; + base.EquivalentTo(other) && other is LegacySampleControlPoint otherTyped && + CustomSampleBank == otherTyped.CustomSampleBank; } } }