Fix panic in PropDef.GetValue for person property types. (#2218)

* Fixed panic in PropDef.GetValue for `person` property types.
- the GetUserByID API can return a nil user and nil error

* return userid
This commit is contained in:
Doug Lauder 2022-02-02 08:39:35 -05:00 committed by GitHub
parent 5030b1e582
commit 46801d72cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,6 +91,9 @@ func (pd PropDef) GetValue(v interface{}, resolver PropValueResolver) (string, e
if err != nil { if err != nil {
return "", err return "", err
} }
if user == nil {
return userID, nil
}
return user.Username, nil return user.Username, nil
} }
return userID, nil return userID, nil