Skip to content

Commit

Permalink
query: Return empty array instead of nil from API
Browse files Browse the repository at this point in the history
Signed-off-by: Prem Kumar <prmsrswt@gmail.com>
  • Loading branch information
onprem committed Jun 14, 2020
1 parent deda923 commit 294823d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/query/api/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,10 @@ func (api *API) labelValues(r *http.Request) (interface{}, []error, *ApiError) {
return nil, nil, &ApiError{errorExec, err}
}

if vals == nil {
vals = make([]string, 0)
}

return vals, warnings, nil
}

Expand Down

0 comments on commit 294823d

Please sign in to comment.