Merge pull request #172 from PsychoLlama/master

Fix thrown error in `.set`
This commit is contained in:
Mark Nadal 2016-02-21 09:05:47 -08:00
commit 52463a5a20

1
gun.js
View File

@ -976,6 +976,7 @@
Gun.chain.set = function(item, cb, opt){
var gun = this, ctx = {}, chain;
cb = cb || function(){};
if(!Gun.is(item)){ return cb.call(gun, {err: Gun.log('Set only supports node references currently!')}), gun } // TODO: Bug? Should we return not gun on error?
(ctx.chain = item.chain()).back = gun;
ctx.chain._ = item._;