From fb4977b936a54497434967997f61ae18a1d44373 Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Fri, 21 Aug 2020 10:02:57 +0800 Subject: fix /libpod/pods/json returns null when there are no pods Signed-off-by: zhangguanzhang --- pkg/api/handlers/utils/pods.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/api/handlers/utils/pods.go b/pkg/api/handlers/utils/pods.go index 8276fb55e..54ebe2d29 100644 --- a/pkg/api/handlers/utils/pods.go +++ b/pkg/api/handlers/utils/pods.go @@ -45,7 +45,7 @@ func GetPods(w http.ResponseWriter, r *http.Request) ([]*entities.ListPodsReport } if len(pods) == 0 { - return nil, nil + return []*entities.ListPodsReport{}, nil } lps := make([]*entities.ListPodsReport, 0, len(pods)) -- cgit v1.2.3-54-g00ecf