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
1 changed files with 6 additions and 0 deletions

View File

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