mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09:00
Check for possible null ranks
This commit is contained in:
parent
d86ce816c7
commit
bcd568e607
@ -42,12 +42,12 @@ namespace osu.Game.Tests.Visual
|
|||||||
LastVisit = DateTimeOffset.Now,
|
LastVisit = DateTimeOffset.Now,
|
||||||
Age = 1,
|
Age = 1,
|
||||||
ProfileOrder = new[] { "me" },
|
ProfileOrder = new[] { "me" },
|
||||||
CountryRank = 1,
|
|
||||||
Statistics = new UserStatistics
|
Statistics = new UserStatistics
|
||||||
{
|
{
|
||||||
Rank = 2148,
|
Rank = 2148,
|
||||||
PP = 4567.89m
|
PP = 4567.89m
|
||||||
},
|
},
|
||||||
|
CountryRank = 1,
|
||||||
RankHistory = new User.RankHistoryData
|
RankHistory = new User.RankHistoryData
|
||||||
{
|
{
|
||||||
Mode = @"osu",
|
Mode = @"osu",
|
||||||
|
@ -26,9 +26,9 @@ namespace osu.Game.Users
|
|||||||
[JsonProperty(@"age")]
|
[JsonProperty(@"age")]
|
||||||
public int? Age;
|
public int? Age;
|
||||||
|
|
||||||
public int GlobalRank { get => Statistics.Ranks.GlobalRank; set => Statistics.Ranks.GlobalRank = value; }
|
public int GlobalRank { get => Statistics?.Ranks.GlobalRank ?? 0; set => Statistics.Ranks.GlobalRank = value; }
|
||||||
|
|
||||||
public int CountryRank { get => Statistics.Ranks.CountryRank; set => Statistics.Ranks.CountryRank = value; }
|
public int CountryRank { get => Statistics?.Ranks.CountryRank ?? 0; set => Statistics.Ranks.CountryRank = value; }
|
||||||
|
|
||||||
//public Team Team;
|
//public Team Team;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ namespace osu.Game.Users
|
|||||||
public decimal? PP;
|
public decimal? PP;
|
||||||
|
|
||||||
[JsonProperty(@"pp_rank")]
|
[JsonProperty(@"pp_rank")]
|
||||||
public int Rank { get => Ranks.GlobalRank; set => Ranks.GlobalRank = value; }
|
public int Rank { get => Ranks.GlobalRank ?? 0; set => Ranks.GlobalRank = value; }
|
||||||
|
|
||||||
[JsonProperty(@"rank")]
|
[JsonProperty(@"rank")]
|
||||||
public UserRank Ranks;
|
public UserRank Ranks;
|
||||||
@ -31,10 +31,10 @@ namespace osu.Game.Users
|
|||||||
public struct UserRank
|
public struct UserRank
|
||||||
{
|
{
|
||||||
[JsonProperty(@"global")]
|
[JsonProperty(@"global")]
|
||||||
public int GlobalRank;
|
public int? GlobalRank;
|
||||||
|
|
||||||
[JsonProperty(@"country")]
|
[JsonProperty(@"country")]
|
||||||
public int CountryRank;
|
public int? CountryRank;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonProperty(@"ranked_score")]
|
[JsonProperty(@"ranked_score")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user