guard against the possible non-existence of metadata for a channel

pull/1/head
ansuz 5 years ago
parent 6c5b3c8d14
commit 4e8ebac3c1

@ -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];

Loading…
Cancel
Save