1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-02-07 13:31:38 +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 34fb356f18
commit 3a29fbf9ce

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
}