Only parse statistics when not null

This commit is contained in:
Dean Herbert 2019-12-03 16:16:27 +09:00
parent 1ce6a5ceb3
commit e2591f154b

View File

@ -40,33 +40,36 @@ namespace osu.Game.Online.API.Requests.Responses
Mods = mods,
};
foreach (var kvp in Statistics)
if (Statistics != null)
{
switch (kvp.Key)
foreach (var kvp in Statistics)
{
case @"count_geki":
scoreInfo.SetCountGeki(kvp.Value);
break;
switch (kvp.Key)
{
case @"count_geki":
scoreInfo.SetCountGeki(kvp.Value);
break;
case @"count_300":
scoreInfo.SetCount300(kvp.Value);
break;
case @"count_300":
scoreInfo.SetCount300(kvp.Value);
break;
case @"count_katu":
scoreInfo.SetCountKatu(kvp.Value);
break;
case @"count_katu":
scoreInfo.SetCountKatu(kvp.Value);
break;
case @"count_100":
scoreInfo.SetCount100(kvp.Value);
break;
case @"count_100":
scoreInfo.SetCount100(kvp.Value);
break;
case @"count_50":
scoreInfo.SetCount50(kvp.Value);
break;
case @"count_50":
scoreInfo.SetCount50(kvp.Value);
break;
case @"count_miss":
scoreInfo.SetCountMiss(kvp.Value);
break;
case @"count_miss":
scoreInfo.SetCountMiss(kvp.Value);
break;
}
}
}