diff --git a/pkg/common/db/unrelation/msg.go b/pkg/common/db/unrelation/msg.go index 55b871b7b..0a6b84802 100644 --- a/pkg/common/db/unrelation/msg.go +++ b/pkg/common/db/unrelation/msg.go @@ -120,6 +120,9 @@ func (m *MsgMongoDriver) GetOldestMsg(ctx context.Context, sourceID string) (*ta } func (m *MsgMongoDriver) Delete(ctx context.Context, docIDs []string) error { + if docIDs == nil { + return nil + } _, err := m.MsgCollection.DeleteMany(ctx, bson.M{"uid": bson.M{"$in": docIDs}}) return err }