1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:42:56 +08:00

Add null check to resolve inspection

This commit is contained in:
Bartłomiej Dach 2021-12-04 14:55:35 +01:00
parent 16fd7f5a28
commit 53a6ef22ce
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -187,7 +187,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Participants
// Todo: Should use the room's selected item to determine ruleset.
var ruleset = rulesets.GetRuleset(0)?.CreateInstance();
int? currentModeRank = User.User?.RulesetsStatistics?.GetValueOrDefault(ruleset.ShortName)?.GlobalRank;
int? currentModeRank = ruleset != null ? User.User?.RulesetsStatistics?.GetValueOrDefault(ruleset.ShortName)?.GlobalRank : null;
userRankText.Text = currentModeRank != null ? $"#{currentModeRank.Value:N0}" : string.Empty;
userStateDisplay.UpdateStatus(User.State, User.BeatmapAvailability);