🚑 Fix server panic when new message

This commit is contained in:
LittleSheep 2024-06-09 22:43:21 +08:00
parent 40179a5557
commit fa50baf927

View File

@ -95,8 +95,8 @@ func NewMessage(message models.Message) (models.Message, error) {
case models.NotifyLevelNone:
continue
case models.NotifyLevelMentioned:
if member.ID == message.ReplyTo.SenderID {
continue
if message.ReplyTo != nil && member.ID == message.ReplyTo.SenderID {
break
}
if val, ok := message.Content["mentioned_users"]; ok {
if usernames, ok := val.([]string); ok {