mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Add null checks to prevent nullrefexception in automated test
This commit is contained in:
parent
5e0ccb6c91
commit
6a85f5ca8b
@ -42,7 +42,15 @@ namespace osu.Game.Tournament.Components
|
||||
}
|
||||
else
|
||||
{
|
||||
var modIcon = rulesets.GetRuleset(ladderInfo.Ruleset.Value.ID ?? 0).CreateInstance().GetAllMods().FirstOrDefault(mod => mod.Acronym == ModAcronym);
|
||||
var ruleset = rulesets.AvailableRulesets.FirstOrDefault(r => r == ladderInfo.Ruleset.Value);
|
||||
|
||||
if (ruleset == null)
|
||||
return;
|
||||
|
||||
var modIcon = ruleset.CreateInstance().GetAllMods().FirstOrDefault(mod => mod.Acronym == ModAcronym);
|
||||
|
||||
if (modIcon == null)
|
||||
return;
|
||||
|
||||
AddInternal(new ModIcon(modIcon)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user