Added this check on ine 2151 to prevent an error when using ESM

This commit is contained in:
joedakroub 2020-04-10 10:48:01 -04:00
parent 17f90d6d10
commit 46b0fb6dc5

2
gun.js
View File

@ -2148,7 +2148,7 @@
var message, loop;
function each(peer){ mesh.say(message, peer) }
var say = mesh.say = function(msg, peer){
if(this.to){ this.to.next(msg) } // compatible with middleware adapters.
if(this && this.to){ this.to.next(msg) } // compatible with middleware adapters.
if(!msg){ return false }
var id, hash, tmp, raw;
var DBG = msg.DBG, S; if(!peer){ S = +new Date ; DBG && (DBG.y = S) }