From 6efb1a670597d34c3db12e389f18b27aee4f0008 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 7 Jun 2022 10:40:19 +0800 Subject: [PATCH] fix bug: v.MsgData == nil --- internal/msg_transfer/logic/online_history_msg_handler.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/msg_transfer/logic/online_history_msg_handler.go b/internal/msg_transfer/logic/online_history_msg_handler.go index fb5b33ce9..e42bbf22a 100644 --- a/internal/msg_transfer/logic/online_history_msg_handler.go +++ b/internal/msg_transfer/logic/online_history_msg_handler.go @@ -107,6 +107,10 @@ func (och *OnlineHistoryConsumerHandler) Run(channelID int) { log.Debug(triggerID, "msg arrived channel", "channel id", channelID, msgList, msgChannelValue.userID, len(msgList)) for _, v := range msgList { log.Debug(triggerID, "msg come to storage center", v.String()) + if v.MsgData == nil { + log.NewWarn(triggerID, "msg come to storage center nil", v.String()) + continue + } isHistory := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsHistory) isSenderSync := utils.GetSwitchFromOptions(v.MsgData.Options, constant.IsSenderSync) if isHistory {