diff --git a/pkg/search/handler.go b/pkg/search/handler.go index 14af2fd0d..dcee86322 100644 --- a/pkg/search/handler.go +++ b/pkg/search/handler.go @@ -661,6 +661,11 @@ func (sh *Handler) serveFiles(rw http.ResponseWriter, req *http.Request) { return } + // the ui code expects an object + if files == nil { + files = []blob.Ref{} + } + ret.Files = files return } diff --git a/pkg/types/camtypes/search.go b/pkg/types/camtypes/search.go index acc7ce2d2..c132680fa 100644 --- a/pkg/types/camtypes/search.go +++ b/pkg/types/camtypes/search.go @@ -250,5 +250,5 @@ type SearchErrorResponse struct { type FileSearchResponse struct { SearchErrorResponse - Files []blob.Ref `json:"files,omitempty"` // Refs of the result files. + Files []blob.Ref `json:"files"` // Refs of the result files. Never nil. }