From 3f3d4e38d44e21727e55fc628113357f9918c268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Mon, 17 May 2021 16:43:39 +0200 Subject: [PATCH] Avoid crash when `--json` doesn't request `nameWithOwner` --- pkg/cmd/repo/list/http.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/repo/list/http.go b/pkg/cmd/repo/list/http.go index 1dbe372e4..ef574b43c 100644 --- a/pkg/cmd/repo/list/http.go +++ b/pkg/cmd/repo/list/http.go @@ -158,7 +158,7 @@ pagination: listResult.TotalCount = result.Search.RepositoryCount for _, repo := range result.Search.Nodes { - if listResult.Owner == "" { + if listResult.Owner == "" && repo.NameWithOwner != "" { idx := strings.IndexRune(repo.NameWithOwner, '/') listResult.Owner = repo.NameWithOwner[:idx] }