From fa50baf927cd0cc87757a1771e0a9916889b85b6 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 9 Jun 2024 22:43:21 +0800 Subject: [PATCH] :ambulance: Fix server panic when new message --- pkg/services/messages.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/services/messages.go b/pkg/services/messages.go index a73fd9a..b848360 100644 --- a/pkg/services/messages.go +++ b/pkg/services/messages.go @@ -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 {