From 58ba4592ec8cd5bb6447b20ae2a54247dd608d06 Mon Sep 17 00:00:00 2001 From: takumadx Date: Tue, 20 Aug 2019 13:28:01 +0900 Subject: [PATCH] tune --- lib/peer/peer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/peer/peer.js b/lib/peer/peer.js index 51788be..bd674fa 100644 --- a/lib/peer/peer.js +++ b/lib/peer/peer.js @@ -1074,7 +1074,9 @@ Peer.prototype.emitError = function(type, err) { if (typeof err === 'string') { err = new Error(err); } - err.type = type; + if (err) { + err.type = type; + } this.emit('error', err); };