fix(character): handle undefined characterModelTransmogs array
Add checks for Array.isArray(charData.characterModelTransmogs) to prevent errors when the array is undefined
This commit is contained in:
parent
2d78ecbf3c
commit
87151da182
1 changed files with 3 additions and 2 deletions
|
|
@ -390,7 +390,8 @@ async function parseModels(): Promise<void> {
|
||||||
const texturesOffset = buffer.readUInt32LE(60);
|
const texturesOffset = buffer.readUInt32LE(60);
|
||||||
const uncompressedSize = buffer.readUInt32LE(112);
|
const uncompressedSize = buffer.readUInt32LE(112);
|
||||||
const compressedData = buffer.slice(116);
|
const compressedData = buffer.slice(116);
|
||||||
const data = Buffer.from(pako.inflate(compressedData));
|
const inflated = pako.inflate(new Uint8Array(compressedData));
|
||||||
|
const data = Buffer.from(inflated);
|
||||||
if (data.length !== uncompressedSize) {
|
if (data.length !== uncompressedSize) {
|
||||||
throw `Unexpected data size ${data.length}, expected ${uncompressedSize}`;
|
throw `Unexpected data size ${data.length}, expected ${uncompressedSize}`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue