fix(xen-api/_call): ensure args always defined
Otherwise it might cause JSON-RPC issue on some XAPI versions (missing `params` field) or problems when augmenting errors with `call.params` (*TypeError: Cannot read properties of undefined (reading '0')*).
This commit is contained in:
@@ -728,7 +728,7 @@ export class Xapi extends EventEmitter {
|
||||
// Private
|
||||
// ===========================================================================
|
||||
|
||||
async _call(method, args, timeout = this._callTimeout(method, args)) {
|
||||
async _call(method, args = [], timeout = this._callTimeout(method, args)) {
|
||||
const startTime = Date.now()
|
||||
try {
|
||||
const result = await pTimeout.call(this._addSyncStackTrace(this._transport(method, args)), timeout)
|
||||
|
||||
Reference in New Issue
Block a user