1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-26 12:10:32 +08:00

Change loose api ordering requirement to throw instead

This commit is contained in:
Dean Herbert
2021-11-01 13:22:16 +09:00
Unverified
parent 269a8df0ec
commit 708b57348d
@@ -50,8 +50,11 @@ namespace osu.Game.Online.API.Requests.Responses
set
{
// in the deserialisation case we need to ferry this data across.
if (Beatmap is APIBeatmap apiBeatmap)
apiBeatmap.BeatmapSet = value;
// the order of properties returned by the API guarantees that the beatmap is populated by this point.
if (!(Beatmap is APIBeatmap apiBeatmap))
throw new InvalidOperationException("Beatmap set metadata arrived before beatmap metadata in response");
apiBeatmap.BeatmapSet = value;
}
}