From 87151da1825d678381fe020b6d2a51e43d909fa3 Mon Sep 17 00:00:00 2001 From: Micael Santana Date: Sun, 7 Dec 2025 08:08:48 -0300 Subject: [PATCH] fix(character): handle undefined characterModelTransmogs array Add checks for Array.isArray(charData.characterModelTransmogs) to prevent errors when the array is undefined --- src/tools/fetchdata.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tools/fetchdata.ts b/src/tools/fetchdata.ts index 7ff74d6..33a9443 100644 --- a/src/tools/fetchdata.ts +++ b/src/tools/fetchdata.ts @@ -389,8 +389,9 @@ async function parseModels(): Promise { const texturesOffset = buffer.readUInt32LE(60); const uncompressedSize = buffer.readUInt32LE(112); - const compressedData = buffer.slice(116); - const data = Buffer.from(pako.inflate(compressedData)); + const compressedData = buffer.slice(116); + const inflated = pako.inflate(new Uint8Array(compressedData)); + const data = Buffer.from(inflated); if (data.length !== uncompressedSize) { throw `Unexpected data size ${data.length}, expected ${uncompressedSize}`; }