From 75f7edff8a0b066a88e11010d44a3dc32e977e1d Mon Sep 17 00:00:00 2001 From: Arpit Agrawal Date: Thu, 30 Apr 2020 23:59:10 +0530 Subject: [PATCH] Fix removes a logger when pass undefined transport (#1785) Co-authored-by: Arpit --- lib/winston/logger.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/winston/logger.js b/lib/winston/logger.js index 8855a9dc3..a3f60a7ae 100644 --- a/lib/winston/logger.js +++ b/lib/winston/logger.js @@ -373,6 +373,7 @@ class Logger extends Transform { * @returns {Logger} - TODO: add return description. */ remove(transport) { + if (!transport) return this; let target = transport; if (!isStream(transport) || transport.log.length > 2) { target = this.transports.filter(