From 2c53be7853145c2f699104026572eb3e36449100 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 27 Nov 2017 18:39:13 +0900 Subject: [PATCH] Fix possible invalid cast when generating mania patterns --- osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs index f6d30ad3fa..d5a799b4ed 100644 --- a/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs +++ b/osu.Game.Rulesets.Mania/Beatmaps/ManiaBeatmapConverter.cs @@ -138,8 +138,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps Pattern newPattern = conversion.Generate(); lastPattern = newPattern; - var stairPatternGenerator = (HitObjectPatternGenerator)conversion; - lastStair = stairPatternGenerator.StairType; + var stairPatternGenerator = conversion as HitObjectPatternGenerator; + lastStair = stairPatternGenerator?.StairType ?? lastStair; return newPattern.HitObjects; }