Fixed division by zero error on communities

This commit is contained in:
kolaente 2019-09-03 21:53:58 +02:00
parent 6b007411cd
commit ef4a9f2ee0
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,9 @@ func (c *Community) ReadAll(orderby string) (interface{}, error) {
}
for i, c := range communities {
if c.KCoins == 0 {
continue // Would otherwise divide by zero
}
communities[i].CoinsQuota = float64(c.KCoins) / float64(c.KonfiCount)
}