feat: fix GetUserByUserId() API crash issue

This commit is contained in:
Yang Luo
2024-02-12 18:51:55 +08:00
parent 23bb0ee450
commit cb200687dc

View File

@ -156,6 +156,10 @@ func (c *ApiController) GetUser() {
c.ResponseError(err.Error())
return
}
if userFromUserId == nil {
c.ResponseOk(nil)
return
}
id = util.GetId(userFromUserId.Owner, userFromUserId.Name)
}