mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-07-15 01:04:38 +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:
committed by
Wes McNamee
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)
|
jerr := NewJiraError(resp, err)
|
||||||
return nil, resp, jerr
|
return nil, resp, jerr
|
||||||
}
|
}
|
||||||
|
if role.Self == "" {
|
||||||
|
return nil, resp, fmt.Errorf("No role with ID %d found", roleID)
|
||||||
|
}
|
||||||
|
|
||||||
return role, resp, err
|
return role, resp, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user