From 98f6fb9d5b3a2da7d7f06da3235a5a86d083396f Mon Sep 17 00:00:00 2001 From: Tau Date: Fri, 24 May 2019 22:04:10 -0400 Subject: [PATCH] idz: Fix backwards compatibility Silently drop OOB course IDs instead of erroring. Those IDs may come from later versions which have bigger arrays in that spot. --- src/idz/encoder/loadProfile2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/idz/encoder/loadProfile2.ts b/src/idz/encoder/loadProfile2.ts index 9cd8832..6a31646 100644 --- a/src/idz/encoder/loadProfile2.ts +++ b/src/idz/encoder/loadProfile2.ts @@ -53,7 +53,7 @@ export function loadProfile2(res: LoadProfileResponse2) { for (const [courseId, playCount] of res.coursePlays.entries()) { if (courseId < 0 || courseId >= 16) { - throw new Error(`Course id out of range: ${courseId}`); + continue; } buf.writeUInt16LE(playCount, 0x0460 + 2 * courseId);