make Global- and CountryLeaderboardRank nullable

This commit is contained in:
Morgan Bazalgette
2017-04-13 08:57:11 +02:00
parent 622658f5aa
commit cc90105130
2 changed files with 21 additions and 12 deletions

View File

@@ -293,11 +293,11 @@ LIMIT 1
for modeID, m := range [...]*modeData{&r.STD, &r.Taiko, &r.CTB, &r.Mania} {
m.Level = ocl.GetLevelPrecise(int64(m.TotalScore))
if i := leaderboardPosition(md.R, modesToReadable[modeID], r.ID); i != 0 {
m.GlobalLeaderboardRank = &i
if i := leaderboardPosition(md.R, modesToReadable[modeID], r.ID); i != nil {
m.GlobalLeaderboardRank = i
}
if i := countryPosition(md.R, modesToReadable[modeID], r.ID, r.Country); i != 0 {
m.CountryLeaderboardRank = &i
if i := countryPosition(md.R, modesToReadable[modeID], r.ID, r.Country); i != nil {
m.CountryLeaderboardRank = i
}
}