mirror of https://github.com/ppy/osu
Fix crash caused by user json order changing
This commit is contained in:
parent
7c428011a2
commit
c18248c827
|
@ -173,8 +173,27 @@ public class KudosuCount
|
|||
public int Available;
|
||||
}
|
||||
|
||||
private UserStatistics statistics;
|
||||
|
||||
[JsonProperty(@"statistics")]
|
||||
public UserStatistics Statistics;
|
||||
public UserStatistics Statistics
|
||||
{
|
||||
get => statistics ??= new UserStatistics();
|
||||
set
|
||||
{
|
||||
if (statistics != null)
|
||||
// we may already have rank history populated
|
||||
value.RankHistory = statistics.RankHistory;
|
||||
|
||||
statistics = value;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty(@"rankHistory")]
|
||||
private RankHistoryData rankHistory
|
||||
{
|
||||
set => statistics.RankHistory = value;
|
||||
}
|
||||
|
||||
public class RankHistoryData
|
||||
{
|
||||
|
@ -185,12 +204,6 @@ public class RankHistoryData
|
|||
public int[] Data;
|
||||
}
|
||||
|
||||
[JsonProperty(@"rankHistory")]
|
||||
private RankHistoryData rankHistory
|
||||
{
|
||||
set => Statistics.RankHistory = value;
|
||||
}
|
||||
|
||||
[JsonProperty("badges")]
|
||||
public Badge[] Badges;
|
||||
|
||||
|
|
Loading…
Reference in New Issue