From fd5f61562d1aa8153dabfc0ea7ccdf89938259f3 Mon Sep 17 00:00:00 2001 From: Matt Carter Date: Thu, 16 Nov 2017 07:00:43 -0600 Subject: [PATCH] Add check for msg payload in rpc handler --- lib/rpc.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rpc.js b/lib/rpc.js index 0f79370..0ac2451 100644 --- a/lib/rpc.js +++ b/lib/rpc.js @@ -46,7 +46,7 @@ _Options.extend({ if (correlationId in requests) { var p = requests[correlationId]; delete requests[correlationId]; - if (msg.error) { + if (msg && msg.error) { p.errback(new Error(msg.error)); } else { p.callback(msg); diff --git a/package.json b/package.json index 80b1376..a45ef78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hare", - "version": "1.0.2", + "version": "1.0.3", "description": "Wrapper around amqp to make common patterns easier", "keywords": [ "amqp",