1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-06-02 22:57:25 +02:00

Add missing check to permissionSchemeService.Get

There was missing a check for requests with invalid ID.
Now it returns an error instead of an empty permissionScheme.
This commit is contained in:
Matthias Weiss 2019-05-09 13:11:55 +02:00 committed by Wes McNamee
parent e3085796b2
commit 84c27294c0

View File

@ -61,6 +61,9 @@ func (s *PermissionSchemeService) Get(schemeID int) (*PermissionScheme, *Respons
jerr := NewJiraError(resp, err)
return nil, resp, jerr
}
if ps.Self == "" {
return nil, resp, fmt.Errorf("No permissionscheme with ID %d found", schemeID)
}
return ps, resp, nil
}