diff --git a/pkg/common/db/controller/conversation.go b/pkg/common/db/controller/conversation.go index cb2dc6f15..cc27f8f73 100644 --- a/pkg/common/db/controller/conversation.go +++ b/pkg/common/db/controller/conversation.go @@ -221,9 +221,11 @@ func (c *ConversationDataBase) CreateGroupChatConversation(ctx context.Context, conversations = append(conversations, &conversation) } cache = cache.DelConversationIDs(notExistUserIDs...).DelUserConversationIDsHash(notExistUserIDs...) - err = c.conversationDB.Create(ctx, conversations) - if err != nil { - return err + if len(conversations) > 0 { + err = c.conversationDB.Create(ctx, conversations) + if err != nil { + return err + } } _, err = c.conversationDB.UpdateByMap(ctx, existConversationUserIDs, conversationID, map[string]interface{}{"max_seq": 0}) if err != nil {