From 4e8ebac3c13605eadf01fee64b3a963f3e3dfe0d Mon Sep 17 00:00:00 2001 From: ansuz Date: Mon, 9 Mar 2020 17:42:10 -0400 Subject: [PATCH] guard against the possible non-existence of metadata for a channel --- lib/hk-util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hk-util.js b/lib/hk-util.js index 7545c2f56..3f0aed360 100644 --- a/lib/hk-util.js +++ b/lib/hk-util.js @@ -955,7 +955,7 @@ HK.onChannelMessage = function (Env, Server, channel, msgStruct) { })); }).nThen(function (w) { // if there's no validateKey present skip to the next block - if (!metadata.validateKey) { return; } + if (!(metadata && metadata.validateKey)) { return; } // trim the checkpoint indicator off the message if it's present let signedMsg = (isCp) ? msgStruct[4].replace(CHECKPOINT_PATTERN, '') : msgStruct[4];