mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Merge pull request #20142 from peppy/fix-textbox-potential-crash
Fix textbox sample playback potentially crashing if called before load
This commit is contained in:
commit
764bb7a8e1
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user