Fix login failure for users with no country rank

Closes #2148.
This commit is contained in:
Dean Herbert
2018-03-11 00:44:00 +09:00
parent a9327eac8f
commit 9233266fe1
4 changed files with 19 additions and 10 deletions

View File

@ -95,7 +95,7 @@ namespace osu.Game.Overlays.Profile
{
placeholder.FadeIn(fade_duration, Easing.Out);
if (user == null)
if (user?.Statistics?.Ranks.Global == null)
{
rankText.Text = string.Empty;
performanceText.Text = string.Empty;
@ -105,7 +105,7 @@ namespace osu.Game.Overlays.Profile
return;
}
int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Ranks.Global };
int[] userRanks = user.RankHistory?.Data ?? new[] { user.Statistics.Ranks.Global.Value };
ranks = userRanks.Select((x, index) => new KeyValuePair<int, int>(index, x)).Where(x => x.Value != 0).ToArray();
if (ranks.Length > 1)