1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Add some very basic safety checks around non-existent data

This commit is contained in:
smoogipoo 2020-06-16 17:20:38 +09:00
parent 9ea7c3dc90
commit 3dbe164b2c
2 changed files with 8 additions and 2 deletions

View File

@ -153,8 +153,11 @@ namespace osu.Game.Rulesets.Osu.Statistics
}
}
foreach (var o in offsets)
AddPoint(o.Position1, o.Position2, o.HitPosition, o.Radius);
if (offsets?.Count > 0)
{
foreach (var o in offsets)
AddPoint(o.Position1, o.Position2, o.HitPosition, o.Radius);
}
sizeLayout.Validate();
}

View File

@ -36,6 +36,9 @@ namespace osu.Game.Rulesets.Osu.Statistics
[BackgroundDependencyLoader]
private void load()
{
if (distribution?.Bins == null || distribution.Bins.Length == 0)
return;
int maxCount = distribution.Bins.Max();
var bars = new Drawable[distribution.Bins.Length];