Skip to content

Fix line break bug, aka 'Cannot read property 'color' of undefined' (#4) #5

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

Merged
merged 2 commits into from
Jun 1, 2018

Conversation

axifive
Copy link
Contributor

@axifive axifive commented May 31, 2018

Hello. I did a little refactoring. And added fix #4

You can show this bug here

And fix here

};

var findLineBreak = function (row) {
if (!row) {
Copy link

Choose a reason for hiding this comment

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

I think there should also need to have check || row.length === 0 just to be sure not to have infinite loop below in unexpected corner case

Copy link
Contributor Author

@axifive axifive May 31, 2018

Choose a reason for hiding this comment

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

postfix decrement in the while loop returns 0 what's stops it, and row.length can't be negative

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.

Cannot read property 'color' of undefined
3 participants