Check user and teams nil state instead of length
This commit is contained in:
parent
eb30e67236
commit
273fccd908
1 changed files with 4 additions and 4 deletions
|
|
@ -638,10 +638,10 @@ func AddPullRequestReviews(client *Client, repo ghrepo.Interface, prNumber int,
|
|||
}
|
||||
|
||||
// The API requires empty arrays instead of null values
|
||||
if len(users) == 0 {
|
||||
if users == nil {
|
||||
users = []string{}
|
||||
}
|
||||
if len(teams) == 0 {
|
||||
if teams == nil {
|
||||
teams = []string{}
|
||||
}
|
||||
|
||||
|
|
@ -673,10 +673,10 @@ func RemovePullRequestReviews(client *Client, repo ghrepo.Interface, prNumber in
|
|||
}
|
||||
|
||||
// The API requires empty arrays instead of null values
|
||||
if len(users) == 0 {
|
||||
if users == nil {
|
||||
users = []string{}
|
||||
}
|
||||
if len(teams) == 0 {
|
||||
if teams == nil {
|
||||
teams = []string{}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue