From 7963c8902011f22e2392f3678b537c05e684d5bd Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 11 May 2015 21:34:36 -0700 Subject: Fix webrtc crash from command line Sometimes RTCPeerConnection.getStats() doesn't return an ip:port for peers --- bin/cmd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/cmd.js b/bin/cmd.js index f60fe93..d695e95 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -530,7 +530,9 @@ function drawTorrent (torrent) { '{3:%s} {25+magenta:%s} {10:%s} {10+cyan:%s/s} {10+red:%s/s} {15+grey:%s}' + '{15+cyan:%s}', progress, - wire.remoteAddress + ':' + wire.remotePort, + wire.remoteAddress + ? (wire.remoteAddress + ':' + wire.remotePort) + : 'Unknown', prettyBytes(wire.downloaded), prettyBytes(wire.downloadSpeed()), prettyBytes(wire.uploadSpeed()), -- cgit v1.2.3