From 7af34976c2d81f533f1ef6c26eeaab24f001dd78 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Thu, 13 Apr 2017 13:54:12 -0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20Error=20when=20returning=20undefined=20?= =?UTF-8?q?from=20incoming=20intergation=E2=80=99s=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/rocketchat-integrations/server/api/api.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-integrations/server/api/api.js b/packages/rocketchat-integrations/server/api/api.js index 2a5ee2806b9c..967aa65cc2be 100644 --- a/packages/rocketchat-integrations/server/api/api.js +++ b/packages/rocketchat-integrations/server/api/api.js @@ -208,9 +208,11 @@ function executeIntegrationRest() { return RocketChat.API.v1.failure(result.error); } this.bodyParams = result && result.content; - this.response = typeof result !== 'undefined' && result.response; - if (result.user) { - this.user = result.user; + if (typeof result !== 'undefined') { + this.response = result.response; + if (result.user) { + this.user = result.user; + } } logger.incoming.debug('[Process Incoming Request result of Trigger', this.integration.name, ':]'); logger.incoming.debug('result', this.bodyParams);