mirror of
https://github.com/discourse/discourse.git
synced 2025-04-17 00:39:31 +08:00
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…
x
Reference in New Issue
Block a user