-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Loader
ZipLoader
Description
When parsing a ZIP archive that contains folder entries (directories), the ZipLoader crashes with:
TypeError: Cannot read properties of null (reading 'async')
Root Cause
In loadZipEntry, the code calls jsZip.file(subFilename).async(...) without checking if jsZip.file()
returns null for folder entries:
async function loadZipEntry(jsZip, subFilename, options = {}) {
try {
const arrayBuffer = await jsZip.file(subFilename).async(options.dataType || "arraybuffer");
return arrayBuffer;
} catch (error) {
options.log.error(`Unable to read ${subFilename} from zip archive: ${error}`);
return error;
}
}When subFilename is a folder (e.g., AgData/Implements/), jsZip.file(subFilename) returns null.
Expected Behavior
We handle folder entries gracefully.
Steps to Reproduce
- Create a zip file with empty folders inside of it.
- Load the zip file as an
ArrayBuffer - Parse the zip (
const result = await parse(buffer, ZipLoader) - Notice the error.
Environment
- Framework version: 4.3.4
- Browser: Chrome 142
- Node: v24.12.0
- OS: Mac OS
Logs
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working