Fix get null object bug.

This commit is contained in:
Yang Luo
2021-06-21 01:01:16 +08:00
parent 54e97d57bf
commit 64f85fdc6c
7 changed files with 32 additions and 1 deletions

View File

@ -78,6 +78,10 @@ func GetUsers(owner string) []*User {
}
func getUser(owner string, name string) *User {
if owner == "" || name == "" {
return nil
}
user := User{Owner: owner, Name: name}
existed, err := adapter.Engine.Get(&user)
if err != nil {