1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

[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
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,