Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #345 TypeError: Cannot read property 'date1904' of undefined #364

Merged
merged 1 commit into from
Jul 31, 2017
Merged

Fix #345 TypeError: Cannot read property 'date1904' of undefined #364

merged 1 commit into from
Jul 31, 2017

Conversation

Diluka
Copy link
Contributor

@Diluka Diluka commented Jul 19, 2017

cant open xlsx saved from Numbers
model.properties is undefined

cant open xlsx saved from Numbers
model.properties is undefined
@@ -127,7 +127,7 @@ utils.inherits(WorkbookXform, BaseXform, {
case 'workbook':
this.model = {
sheets: this.map.sheets.model,
properties: this.map.workbookPr.model,
properties: this.map.workbookPr.model || {},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - could you also add a unit test that catches this issue?
in: spec/unit/xlsx/xform/book/workbook-xform.spec.js
best approach woud be making copies of the spec/unit/xlsx/xform/book/data/book.1.* files and adding a new expectation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. No, actually I don't know how to add the unit test.
I just fixed an .xlsx file parsed with its this.map.workbookPr.model being undefined causing an null reference error.
This because the file itself having a missing property and exceljs supposing it have.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I have a little time now, I'll do it

@guyonroche guyonroche merged commit 36be6ed into exceljs:master Jul 31, 2017
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