Fix potential read from empty queue in SPM counter

This commit is contained in:
Dean Herbert 2017-10-12 18:28:26 +09:00
parent 818cbc0082
commit 1b031ca328

View File

@ -64,7 +64,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
if (records.Count > 0)
{
var record = records.Peek();
while (Time.Current - records.Peek().Time > spm_count_duration)
while (records.Count > 0 && Time.Current - records.Peek().Time > spm_count_duration)
record = records.Dequeue();
SpinsPerMinute = (currentRotation - record.Rotation) / (Time.Current - record.Time) * 1000 * 60 / 360;
}