Adding a second condition just in case

This commit is contained in:
Gabriel Ramírez 2021-10-05 21:43:28 +00:00 committed by GitHub
parent 61b0fe36b2
commit aa49a3a557
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -200,7 +200,7 @@ func (a *API) ListCodespaces(ctx context.Context) (codespaces []*Codespace, err
if err != nil {
return nil, fmt.Errorf("%w", err)
}
if len(codespaces) >= response.TotalCount {
if len(codespaces) >= response.TotalCount || len(response.Codespaces) == 0 {
break
}
codespaces = append(codespaces, response.Codespaces...)