More error handling...

This commit is contained in:
2020-01-03 15:50:52 -05:00
parent 15c4090a94
commit bbec2d8ccf
2 changed files with 10 additions and 1 deletions

View File

@@ -185,9 +185,15 @@ func (api *WebAPI) WorkerSetPaused(r *Request) {
}
func (api *WebAPI) GetAllWorkerStats(r *Request) {
stats := api.Database.GetAllWorkerStats()
if stats == nil {
r.OkJson(JsonResponse{
Ok: false,
})
return
}
r.OkJson(JsonResponse{
Ok: true,
Content: GetAllWorkerStatsResponse{