Jordan Eldredge 2020-10-25 14:20:27 -07:00
parent 8523b0686e
commit 9d4f71546a

View file

@ -23,9 +23,19 @@ export async function getFileFromZip(
if (!files.length) {
return null;
}
let contents;
try {
contents = await files[0].async(mode);
} catch (e) {
console.warn(
`Failed to extract "${fileName}.${ext}" from the skin archive.`
);
return null;
}
// Return a promise (awaitable).
return {
contents: await files[0].async(mode),
contents,
name: files[0].name,
};
}