Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@papandreou
Copy link
Contributor

Hi!

We're running a service that uses exceljs to process uploaded Excel spreadsheets. The other day a user accidentally uploaded a wrongly named .numbers file, which caused an exceljs crash:

     TypeError: Cannot read property 'reduce' of undefined
      at module.exports.reconcile (dist/es5/xlsx/xform/book/workbook-xform.js:145:34)
      at module.exports.reconcile (dist/es5/xlsx/xlsx.js:85:19)
      at dist/es5/xlsx/xlsx.js:316:14

I had a quick look, and it seems like .numbers files also use a zip-based container, but since all the entries are differently named compared to .xlsx, some internal state ends up being unintialized, which makes reconcile break.

Turns out it was rather easy to just default that state so the file loads, but isn't populated with any worksheets. It would probably be better to reject the promise with a specific error, though. What do you think?

@papandreou
Copy link
Contributor Author

papandreou commented Nov 6, 2017 via email

@guyonroche
Copy link
Collaborator

Hey Guys,
Finally I have some time to catch up on excel stuff. This looks good - non breaking benign kind of change so I'm happy to include it. Will try to publish some time this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.