1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Fix textbox sample playback potentially crashing if called before load

This commit is contained in:
Dean Herbert 2022-09-05 16:26:41 +09:00
parent 07d4a025b0
commit 2bec8b82b3

View File

@ -283,7 +283,7 @@ namespace osu.Game.Graphics.UserInterface
return samples[RNG.Next(0, samples.Length)]?.GetChannel();
}
private void playSample(FeedbackSampleType feedbackSample)
private void playSample(FeedbackSampleType feedbackSample) => Schedule(() =>
{
if (Time.Current < sampleLastPlaybackTime + 15) return;
@ -300,7 +300,7 @@ namespace osu.Game.Graphics.UserInterface
channel.Play();
sampleLastPlaybackTime = Time.Current;
}
});
private class OsuCaret : Caret
{