1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: crash when calling badge endpoint with no filters applied (resolve #66)

This commit is contained in:
Ferdinand Mütsch
2020-11-01 16:03:30 +01:00
parent 68e66298b8
commit 96ff490d8d
4 changed files with 15 additions and 10 deletions

View File

@@ -70,6 +70,8 @@ func (h *BadgeHandler) ApiGet(w http.ResponseWriter, r *http.Request) {
filters = models.NewFiltersWith(models.SummaryLanguage, filterKey)
case "machine":
filters = models.NewFiltersWith(models.SummaryMachine, filterKey)
default:
filters = &models.Filters{}
}
summary, err, status := h.loadUserSummary(user, interval)