From d000f9d8b77c92594773f5808546ef39a442e0bb Mon Sep 17 00:00:00 2001 From: TAT Date: Wed, 12 Mar 2014 17:46:41 +0100 Subject: [PATCH] Ensure gateway requests sends an array --- src/client.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client.js b/src/client.js index 5841f8f..2ae2fe2 100644 --- a/src/client.js +++ b/src/client.js @@ -191,6 +191,9 @@ function sendRPC(name, args, callback) { } function sendGateway(name, args, successCallback, failureCallback) { + args = args === undefined ? [] : args; + if (!util.isArray(args)) + args = [args]; var bodyString = JSON.stringify({ service: name, body: args