diff --git a/lib/Connection.js b/lib/Connection.js index 700daab..58d9ea6 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -1114,9 +1114,9 @@ Connection.prototype._resUntagged = function(info) { } if (toget.length === 0) { + if (msg) + msg.ended = true; process.nextTick(function() { - if (msg) - msg.ended = true; msgEmitter.emit('attributes', attrs); msgEmitter.emit('end'); });