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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user