From 37726f6e686d69a1779cee918a1f34605a42b185 Mon Sep 17 00:00:00 2001 From: Joe Still Date: Sun, 18 Oct 2020 17:03:48 -0500 Subject: [PATCH] Fixed issue 935. Detects zero length key --- gun.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gun.js b/gun.js index 3cc08128..6b503e17 100644 --- a/gun.js +++ b/gun.js @@ -1349,6 +1349,10 @@ Gun.chain.get = function(key, cb, as){ var gun, tmp; if(typeof key === 'string'){ + if(key.length == 0) { + (as = this.chain())._.err = {err: Gun.log('Invalid zero length string key!', key)}; + return null + } var back = this, cat = back._; var next = cat.next || empty; if(!(gun = next[key])){