Fix out of bounds exception during indexing

This commit is contained in:
smoogipoo
2019-01-15 10:40:03 +09:00
parent dfc903fec2
commit 88d80016aa

View File

@ -122,8 +122,14 @@ namespace osu.Game.Beatmaps.ControlPoints
return list[pivot];
}
// l will be the first control point with Time > time, but we want the one before it
return list[l - 1];
if (l > 0)
{
// l will be the first control point with Time > time, but we want the one before it
return list[l - 1];
}
// If the binary search failed, l will be unaffected
return list[l];
}
}
}