Made output of nil Meta maps useful

This commit is contained in:
Julian Daube 2017-03-20 11:55:47 +01:00
parent d3f96c348a
commit 29b7e17323

View File

@ -182,6 +182,12 @@ func (h Handler) Meta(resp http.ResponseWriter, path []string) {
} }
cached: cached:
if meta == nil {
// make output useful for nil maps
fmt.Fprint(resp, "[]")
return
}
encoder := json.NewEncoder(resp) encoder := json.NewEncoder(resp)
if len(path) > 1 { if len(path) > 1 {