[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 authored and GitHub committed 2020-01-31 16:13:51 -05:00
1 parent 13bc82009c
commit 8d43563a32
3 files changed
+53 -29

No files matched your search

+3
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,