FIX: don't divide by 0, it's never worth it
This commit is contained in:
parent
139314c213
commit
80e6f54198
|
@ -26,7 +26,7 @@ const Report = Discourse.Model.extend({
|
|||
count++;
|
||||
}
|
||||
});
|
||||
if (this.get("method") === "average") { sum /= count; }
|
||||
if (this.get("method") === "average" && count > 0) { sum /= count; }
|
||||
return round(sum, -2);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue