mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-03-19 20:57:47 +02:00
Add missing check to roleService.Get
There was missing a check for requests with invalid ID. Now it returns an error instead of an empty role.
This commit is contained in:
parent
889618d979
commit
0f45703c19
3
role.go
3
role.go
@ -68,6 +68,9 @@ func (s *RoleService) Get(roleID int) (*Role, *Response, error) {
|
||||
jerr := NewJiraError(resp, err)
|
||||
return nil, resp, jerr
|
||||
}
|
||||
if role.Self == "" {
|
||||
return nil, resp, fmt.Errorf("No role with ID %d found", roleID)
|
||||
}
|
||||
|
||||
return role, resp, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user