1
0
Fork 0
forked from forgejo/forgejo

[BugFix] [API] Pull.API.Convert: Only try to get HeadBranch if HeadRepo exist (#10029)

* only try to get HeadBranch if HeadRepo exist

* impruve

* no nil error

* add TEST

* correct error msg
This commit is contained in:
6543 2020-01-31 22:13:51 +01:00 committed by GitHub
parent 13bc82009c
commit 8d43563a32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 29 deletions

View file

@ -234,6 +234,9 @@ func (u *User) GetEmail() string {
// APIFormat converts a User to api.User
func (u *User) APIFormat() *api.User {
if u == nil {
return nil
}
return &api.User{
ID: u.ID,
UserName: u.Name,