Skip to content

Commit 3f3d4e3

Browse files
committed
Avoid crash when --json doesn't request nameWithOwner
1 parent a2307e3 commit 3f3d4e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/cmd/repo/list/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ pagination:
158158

159159
listResult.TotalCount = result.Search.RepositoryCount
160160
for _, repo := range result.Search.Nodes {
161-
if listResult.Owner == "" {
161+
if listResult.Owner == "" && repo.NameWithOwner != "" {
162162
idx := strings.IndexRune(repo.NameWithOwner, '/')
163163
listResult.Owner = repo.NameWithOwner[:idx]
164164
}

0 commit comments

Comments
 (0)