Skip to content

Commit

Permalink
Merge pull request #14 from erikkallen/patch-1
Browse files Browse the repository at this point in the history
fixes #13 check for NaN explicitly
  • Loading branch information
Andi Dittrich authored Sep 5, 2017
2 parents 7605d2c + 51ec15f commit 9804199
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ Bar.prototype.render = function(){

// calculate the normalized current progress
// handle NaN Errors
var progress = (this.value/this.total) || 1.0;
var progress = (this.value/this.total);

if (isNaN(progress))
progress = 1.0;

// limiter
progress = Math.min(Math.max(progress, 0.0), 1.0);
Expand Down

0 comments on commit 9804199

Please sign in to comment.