From 2b78b90dfaeb05ff6d3ce2ca3fd02eaaa76df86e Mon Sep 17 00:00:00 2001 From: mscdex Date: Sat, 6 Jul 2013 19:07:31 -0400 Subject: [PATCH] Connection: set 'ended' property sooner than the next tick --- lib/Connection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'); });