Skip to content

Commit

Permalink
Fix params being required
Browse files Browse the repository at this point in the history
  • Loading branch information
jackfranklin committed Apr 20, 2020
1 parent f0bcdbb commit fc33391
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Connection.ts
Expand Up @@ -177,7 +177,13 @@ export class CDPSession extends EventEmitter {
send<T extends keyof Protocol.CommandParameters>(method: T, params?: Protocol.CommandParameters[T]): Promise<Protocol.CommandReturnValues[T]> {
if (!this._connection)
return Promise.reject(new Error(`Protocol error (${method}): Session closed. Most likely the ${this._targetType} has been closed.`));
const id = this._connection._rawSend({sessionId: this._sessionId, method, params});

const id = this._connection._rawSend({
sessionId: this._sessionId,
method,
params: params || {}
});

return new Promise((resolve, reject) => {
this._callbacks.set(id, {resolve, reject, error: new Error(), method});
});
Expand Down

0 comments on commit fc33391

Please sign in to comment.