From 05b97399c0502e0879080953343df128fe2816fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Cuevas?= Date: Tue, 7 May 2019 11:36:06 +0200 Subject: [PATCH] Fix divide by zero error --- githubpoints-projects.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/githubpoints-projects.js b/githubpoints-projects.js index 25d86c3..b4a4f64 100644 --- a/githubpoints-projects.js +++ b/githubpoints-projects.js @@ -12,9 +12,14 @@ var calculateIssuePoints = function () { var drawProgressBars = function(to_do, doing, done) { let total = to_do + doing + done; + + let doing_percent = 0; + let done_percent = 0; - let doing_percent = (doing / total) * 100; - let done_percent = (done / total) * 100; + if (total > 0) { + let doing_percent = (doing / total) * 100; + let done_percent = (done / total) * 100; + } let pointsBarElement = document.getElementById('pointsBar');