diff --git a/pkg/common/db/mgo/user.go b/pkg/common/db/mgo/user.go index e1c9ffc90..19fd0e115 100644 --- a/pkg/common/db/mgo/user.go +++ b/pkg/common/db/mgo/user.go @@ -116,7 +116,8 @@ func (u *UserMgo) GetUserCommands(ctx context.Context, userID string, Type int32 } defer cursor.Close(ctx) - var commands []user.CommandInfoResp + // Initialize commands as an empty slice + commands := []user.CommandInfoResp{} for cursor.Next(ctx) { var document struct {