From d52e449f87bd3181d49e5df982921185aed35407 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 3 Sep 2019 13:29:57 +0200 Subject: [PATCH] Fix setMetadata RPC saferphore --- lib/metadata.js | 2 +- rpc.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/metadata.js b/lib/metadata.js index bda0488dd..fb8628410 100644 --- a/lib/metadata.js +++ b/lib/metadata.js @@ -144,7 +144,7 @@ var handleCommand = Meta.handleCommand = function (meta, line) { throw new Error("METADATA_UNSUPPORTED_COMMAND"); } - commands[command](meta, args); + return commands[command](meta, args); }; Meta.commands = Object.keys(commands); diff --git a/rpc.js b/rpc.js index 08a4edecf..352165b0b 100644 --- a/rpc.js +++ b/rpc.js @@ -394,6 +394,7 @@ var setMetadata = function (Env, data, unsafeKey, cb) { // if your command is valid but it didn't result in any change to the metadata, // call back now and don't write any "useless" line to the log if (!changed) { + g(); return void cb(void 0, metadata); } Env.msgStore.writeMetadata(channel, JSON.stringify(line), function (e) {