From 24c1749768aa7b911c67796117563f50c9fd0966 Mon Sep 17 00:00:00 2001 From: Valentin Andruschenko Date: Mon, 2 Jul 2018 16:03:37 +0300 Subject: [PATCH] Issue #49: Message callback: check message body is present --- src/modules/EventuateClient.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/EventuateClient.js b/src/modules/EventuateClient.js index d732152..e7c9df0 100644 --- a/src/modules/EventuateClient.js +++ b/src/modules/EventuateClient.js @@ -506,6 +506,11 @@ export default class EventuateClient { const [ body, ...rest ] = frame.body; + if (!body) { + const err = new Error('Message body not provided'); + logger.error(err); + throw err; + } if (this.subscriptions.hasOwnProperty(subscriberId)) { //call message callback;