mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: don't divide by 0, it's never worth it
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user