diff --git a/lib/winston/logger.js b/lib/winston/logger.js index d6a2fe980..7edee3e52 100755 --- a/lib/winston/logger.js +++ b/lib/winston/logger.js @@ -247,11 +247,20 @@ Logger.prototype.query = function (options, callback) { // function addResults (transport, next) { queryTransport(transport, function (err, result) { - result = err || result; - if (result) { - results[transport.name] = result; + // + // queryTransport could potentially invoke the callback + // multiple times since Transport code can be unpredictable. + // + if (next) { + result = err || result; + if (result) { + results[transport.name] = result; + } + + next(); } - next(); + + next = null; }); }