Fix failing tests related to slider ticks

This commit is contained in:
Andrei Zavatski 2024-02-17 23:28:35 +03:00
parent dd82de473a
commit 572f693eec
1 changed files with 4 additions and 2 deletions

View File

@ -253,7 +253,7 @@ private void updateNestedPositions()
protected void UpdateNestedSamples() protected void UpdateNestedSamples()
{ {
// TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933) // TODO: remove this when guaranteed sort is present for samples (https://github.com/ppy/osu/issues/1933)
HitSampleInfo tickSample = (Samples.FirstOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL) ?? Samples.First()).With("slidertick"); HitSampleInfo tickSample = (Samples.FirstOrDefault(s => s.Name == HitSampleInfo.HIT_NORMAL) ?? Samples.FirstOrDefault())?.With("slidertick");
foreach (var nested in NestedHitObjects) foreach (var nested in NestedHitObjects)
{ {
@ -261,7 +261,9 @@ protected void UpdateNestedSamples()
{ {
case SliderTick tick: case SliderTick tick:
tick.SamplesBindable.Clear(); tick.SamplesBindable.Clear();
tick.SamplesBindable.Add(tickSample);
if (tickSample != null)
tick.SamplesBindable.Add(tickSample);
break; break;
case SliderRepeat repeat: case SliderRepeat repeat: