Fixed issue 935. Detects zero length key

This commit is contained in:
Joe Still 2020-10-18 17:03:48 -05:00
parent 05349a5c68
commit 37726f6e68

4
gun.js
View File

@ -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])){