mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge pull request #1019 from bioshazard/bug/GUN-935
Fixed issue 935. Detects zero length key
This commit is contained in:
commit
4dc88e9ea8
4
gun.js
4
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])){
|
||||
|
Loading…
x
Reference in New Issue
Block a user