Fixed division by zero error on communities
This commit is contained in:
parent
6b007411cd
commit
ef4a9f2ee0
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue