Avoid crash when --json doesn't request nameWithOwner
This commit is contained in:
parent
a2307e357d
commit
3f3d4e38d4
1 changed files with 1 additions and 1 deletions
|
|
@ -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]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue