mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-29 04:50:14 +00:00
Recover if individual files cannot be extracted
See: https://webamp.org/?skinUrl=https://cdn.webampskins.org/skins/0a90a510fcc077b0710f4ff1a763c8c2.wsz And: https://twitter.com/diamante_loco/status/1320374866311262210?s=21
This commit is contained in:
parent
8523b0686e
commit
9d4f71546a
1 changed files with 11 additions and 1 deletions
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue