Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #22 from babbel/is-organization-error
Browse files Browse the repository at this point in the history
raise error if organization can not be validated
  • Loading branch information
fmasuhr authored Jul 1, 2020
2 parents a2b6917 + 02a0eae commit 7cf8b58
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions github/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ func (c *Config) Clients() (interface{}, error) {
owner.name = user.GetLogin()
} else {
remoteOrg, _, err := owner.v3client.Organizations.Get(ctx, owner.name)
if err == nil {
if remoteOrg != nil {
owner.id = remoteOrg.GetID()
owner.IsOrganization = true
}
if err != nil {
return nil, err
}
if remoteOrg != nil {
owner.id = remoteOrg.GetID()
owner.IsOrganization = true
}
}
return &owner, nil
Expand Down

0 comments on commit 7cf8b58

Please sign in to comment.