Reformat stats display, protect against division by zero.

This commit is contained in:
Juliusz Chroboczek committed 2021-05-07 02:23:10 +02:00
1 parent b1bb427f06
commit 86b6c71ca0
3 files changed
+29 -18

No files matched your search

+4 -1
View File
@@ -370,7 +370,10 @@ func statsHandler(w http.ResponseWriter, r *http.Request, dataDir string) {
ss := stats.GetGroups()
e := json.NewEncoder(w)
e.Encode(ss)
err = e.Encode(ss)
if err != nil {
log.Printf("stats.json: %v", err)
}
return
}