From d146f86511ac3b34e995c586ad6889cc2c2ef194 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Nov 2022 15:39:56 +0900 Subject: [PATCH] Fix crash when hitting 'T' to tap timing while no timing point is selected --- osu.Game/Screens/Edit/Timing/TapButton.cs | 3 +++ osu.Game/Screens/Edit/Timing/TapTimingControl.cs | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/osu.Game/Screens/Edit/Timing/TapButton.cs b/osu.Game/Screens/Edit/Timing/TapButton.cs index 151c3cea2e..2944eea4fe 100644 --- a/osu.Game/Screens/Edit/Timing/TapButton.cs +++ b/osu.Game/Screens/Edit/Timing/TapButton.cs @@ -295,6 +295,9 @@ namespace osu.Game.Screens.Edit.Timing private void handleTap() { + if (selectedGroup?.Value == null) + return; + tapTimings.Add(Clock.CurrentTime); if (tapTimings.Count > initial_taps_to_ignore + max_taps_to_consider) diff --git a/osu.Game/Screens/Edit/Timing/TapTimingControl.cs b/osu.Game/Screens/Edit/Timing/TapTimingControl.cs index abc73851e4..daa3168746 100644 --- a/osu.Game/Screens/Edit/Timing/TapTimingControl.cs +++ b/osu.Game/Screens/Edit/Timing/TapTimingControl.cs @@ -183,12 +183,18 @@ namespace osu.Game.Screens.Edit.Timing private void start() { + if (selectedGroup.Value == null) + return; + editorClock.Seek(selectedGroup.Value.Time); editorClock.Start(); } private void reset() { + if (selectedGroup.Value == null) + return; + editorClock.Stop(); editorClock.Seek(selectedGroup.Value.Time); }