Merge pull request #1019 from bioshazard/bug/GUN-935

Fixed issue 935. Detects zero length key
This commit is contained in:
Mark Nadal 2020-10-25 15:09:52 -07:00 committed by GitHub
commit 4dc88e9ea8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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