mirror of https://github.com/gogs/gogs.git
models/user: handle case when user doesn't belong to any organization (#4258)
parent
de2d3e3fd8
commit
bab448681d
2
gogs.go
2
gogs.go
|
@ -16,7 +16,7 @@ import (
|
|||
"github.com/gogits/gogs/modules/setting"
|
||||
)
|
||||
|
||||
const APP_VER = "0.10.9.0308"
|
||||
const APP_VER = "0.10.10.0308"
|
||||
|
||||
func init() {
|
||||
setting.AppVer = APP_VER
|
||||
|
|
|
@ -453,6 +453,9 @@ func (u *User) GetOrganizations(showPrivate bool) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("GetOrgIDsByUserID: %v", err)
|
||||
}
|
||||
if len(orgIDs) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
u.Orgs = make([]*User, 0, len(orgIDs))
|
||||
if err = x.In("id", orgIDs).Find(&u.Orgs); err != nil {
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.10.9.0308
|
||||
0.10.10.0308
|
Loading…
Reference in New Issue