Skip to content

Commit

Permalink
Fix removes a logger when pass undefined transport (#1785)
Browse files Browse the repository at this point in the history
Co-authored-by: Arpit <[email protected]>
  • Loading branch information
arpit728 and arpit728 authored Apr 30, 2020
1 parent 4b571ba commit 75f7edf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/winston/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 75f7edf

Please sign in to comment.