🐛 Use get function to prevent null pointer exception
This commit is contained in:
parent
ff8b681eaa
commit
d97837dab6
@ -123,12 +123,12 @@ func LinkAccountMiddleware(c *fiber.Ctx) error {
|
|||||||
if val, ok := c.Locals("p_user").(*proto.UserInfo); ok {
|
if val, ok := c.Locals("p_user").(*proto.UserInfo); ok {
|
||||||
account := models.Account{
|
account := models.Account{
|
||||||
BaseModel: models.BaseModel{
|
BaseModel: models.BaseModel{
|
||||||
ID: uint(val.Id),
|
ID: uint(val.GetId()),
|
||||||
},
|
},
|
||||||
Name: val.Name,
|
Name: val.GetName(),
|
||||||
Nick: val.Nick,
|
Nick: val.GetNick(),
|
||||||
Avatar: val.Avatar,
|
Avatar: val.GetAvatar(),
|
||||||
Banner: val.Banner,
|
Banner: val.GetBanner(),
|
||||||
Description: val.GetDescription(),
|
Description: val.GetDescription(),
|
||||||
EmailAddress: val.GetEmail(),
|
EmailAddress: val.GetEmail(),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user