From e1fce11e43b8f17ccdaee7fed9672237e8661990 Mon Sep 17 00:00:00 2001 From: syed_25084 Date: Thu, 15 Oct 2020 17:14:03 +0530 Subject: [PATCH] added null check while compaing the differences between existing kvs and current kvs --- lib/consul/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/consul/index.js b/lib/consul/index.js index 5985a84..853d98b 100644 --- a/lib/consul/index.js +++ b/lib/consul/index.js @@ -154,7 +154,7 @@ var diff_kvs = function(write_kvs, delete_kvs, candidate_kvs, existing_kvs) { if (idx === -1) { // key does not exist in the current tree, so we must add it. write_kvs.push(kv); - } else if (kv.value.toString() !== existing_kvs[idx].value) { + } else if (kv.value === null || kv.value.toString() !== existing_kvs[idx].value) { // key exists in the current tree, but has a different value, so we must update it. write_kvs.push(kv); existing_kvs.splice(idx, 1);