From db37d0197a01e58b572930669c8693a4fe619665 Mon Sep 17 00:00:00 2001 From: wenxu12345 <44203734@qq.com> Date: Wed, 29 Dec 2021 11:57:28 +0800 Subject: [PATCH] Refactor code --- internal/api/friend/friend.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/api/friend/friend.go b/internal/api/friend/friend.go index aabae58ce..7cd45e1c0 100644 --- a/internal/api/friend/friend.go +++ b/internal/api/friend/friend.go @@ -403,6 +403,9 @@ func GetFriendApplyList(c *gin.Context) { } resp := api.GetFriendApplyListResp{CommResp: api.CommResp{ErrCode: RpcResp.ErrCode, ErrMsg: RpcResp.ErrMsg}, FriendRequestList: RpcResp.FriendRequestList} + if len(resp.FriendRequestList) == 0 { + resp.FriendRequestList = []*open_im_sdk.FriendRequest{} + } log.NewInfo(req.CommID.OperationID, "GetFriendApplyList api return ", resp) c.JSON(http.StatusOK, resp) }