Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Guard null model fields - fix and tests#403

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

thecjharries
Copy link

I ran into an issue with thereconcile method ofTwoCellAnchorXform. I can't provide the spreadsheet to give you a working demo of the issue, but I did find the problem and built a unit test to display the issue. Basically,model.picture might be null, which throws an error. Once I added the guards, I was able to load the workbook as usual.

}
}
if(Number.isInteger(model.tl.row)&&Number.isInteger(model.tl.col)&&Number.isInteger(model.br.row)&&Number.isInteger(model.br.col)){
if(model.tl&&Number.isInteger(model.tl.row)&&Number.isInteger(model.tl.col)&&Number.isInteger(model.br.row)&&Number.isInteger(model.br.col)){
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth adding a test formodel.br too? Obviously I don't know if it's possible for it to be null or not, but the code doesn't give any indication either way.

Copy link
Author

Choose a reason for hiding this comment

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

Great point. I went ahead and added abr guard and test. I should have done that originally.

Copy link
Author

Choose a reason for hiding this comment

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

I started with thetl guard because I was testing withmodel = {}, which threw an error on that conditional. I didn't have the time to debug everything enough to figure out wheremodel was coming from and why itspicture wasnull, so I'm as in the dark about whether or notbr can benull without anulltl as you are. It doesn't hurt, so there's no reason not to.

@guyonrocheguyonroche merged commit4489266 intoexceljs:masterOct 4, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
1 more reviewer

@RycochetRycochetRycochet left review comments

Reviewers whose approvals may not affect merge requirements
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@thecjharries@Rycochet@guyonroche@shdd-cjharries

[8]ページ先頭

©2009-2025 Movatter.jp