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

Bug fix for potential zero dived by zero #79

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

dustinrpatterson
Copy link
Contributor

There is a bug with this._path.getTotalLength() / alength on line 92. I have a project where this._path.getTotalLength() is computed as 0 and alength also is computed as 0. Dividing 0 by 0 isn't possible in math. When this happens, it breaks the script from going any further.

My proposed change resolves this problem. If this._path.getTotalLength() / alength is evaluated as NaN, it sets test to 0, otherwise test becomes the computed division.

There is a bug with <this._path.getTotalLength() / alength> on line 92. I have a project where this._path.getTotalLength() is computed as 0 and alength also is computed as 0. Dividing 0 by 0 isn't possible in math. When this happens, it breaks the script from going any further. 

My proposed change resolves this problem. If this._path.getTotalLength() / alength is evaluated as NaN, it sets 'test' to 0, otherwise 'test' becomes the computed division.
@clementallen
Copy link

clementallen commented Apr 12, 2019

Duplicate of #65 ?

@dustinrpatterson
Copy link
Contributor Author

Duplicate of #65 ?

It looks like it, just a different approach to solve the problem. I hope that a solution is made soon. This is causing my team some issues in a project.

@clementallen
Copy link

Yup also looks a good fix but I wouldn't hold your breath waiting for it to get merged, there's been no activity for almost a year :( . Frustrating for me too as I'm waiting for #72

@gutard gutard merged commit 0443bf8 into makinacorpus:master Feb 7, 2020
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.

3 participants