Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix user avatar Unmarshal

aichy12692fbdbbc81f7
diff --git a/internal/schema/user_schema.go b/internal/schema/user_schema.go
index 8a0c60a7..079b11c3 100644
--- a/internal/schema/user_schema.go
+++ b/internal/schema/user_schema.go
@@ -96,10 +96,8 @@ func (r *GetUserToSetShowResp) GetFromUserEntity(userInfo *entity.User) {
r.Status = statusShow
}
avatarInfo := &AvatarInfo{}
- err := json.Unmarshal([]byte(userInfo.Avatar), avatarInfo)
- if err != nil {
- log.Error("AvatarInfo json.Unmarshal Error", err)
- }
+ _ = json.Unmarshal([]byte(userInfo.Avatar), avatarInfo)
+ // if json.Unmarshal Error avatarInfo.Type is Empty
r.Avatar = avatarInfo
}