mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Add some very basic safety checks around non-existent data
This commit is contained in:
parent
9ea7c3dc90
commit
3dbe164b2c
@ -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();
|
||||
}
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user