正在显示
1 个修改的文件
包含
4 行增加
和
0 行删除
@@ -33,6 +33,10 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent | @@ -33,6 +33,10 @@ func MessageCenter(header *protocol.RequestHeader, request *protocol.MessageCent | ||
33 | } | 33 | } |
34 | } | 34 | } |
35 | err = models.GetUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &rsp.Totals) | 35 | err = models.GetUserMsgTotals(header.UserId, header.CompanyId, request.MsgType, &rsp.Totals) |
36 | + if rsp.Totals == nil || len(rsp.Totals) == 0 { | ||
37 | + rsp.Totals = make([]*protocol.MessageTotal, 0) | ||
38 | + return | ||
39 | + } | ||
36 | for i := range rsp.Totals { | 40 | for i := range rsp.Totals { |
37 | item := rsp.Totals[i] | 41 | item := rsp.Totals[i] |
38 | if item.MsgType == protocol.MsgTypeThumbUp { | 42 | if item.MsgType == protocol.MsgTypeThumbUp { |
-
请 注册 或 登录 后发表评论