From 1146967b2324d543c21b4cc4c1ec53f8b3831453 Mon Sep 17 00:00:00 2001 From: jsdt Date: Thu, 2 Jan 2020 10:43:05 -0500 Subject: [PATCH] Check if client is set when debug logging. --- lib/torrent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/torrent.js b/lib/torrent.js index 77cf8988..e6ab569d 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1630,7 +1630,7 @@ class Torrent extends EventEmitter { _debug () { const args = [].slice.call(arguments) - args[0] = `[${this.client._debugId}] [${this._debugId}] ${args[0]}` + args[0] = `[${this.client ? this.client._debugId : 'No Client'}] [${this._debugId}] ${args[0]}` debug(...args) }