From 96af8f4a8e256be89a25e51065449fe5d4d3f514 Mon Sep 17 00:00:00 2001 From: Ross Johnson Date: Sat, 6 Jul 2013 10:16:51 -0500 Subject: [PATCH] Fix fetch crash when all parts come back immediately Resolves "TypeError: Cannot set property 'ended' of undefined" if bodies are sent immediately and no msg is added to the fetchCache. --- lib/Connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Connection.js b/lib/Connection.js index 537f6be..084ae7c 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -1115,7 +1115,7 @@ Connection.prototype._resUntagged = function(info) { if (toget.length === 0) { process.nextTick(function() { - msg.ended = true; + if (msg) msg.ended = true; msgEmitter.emit('attributes', attrs); msgEmitter.emit('end'); });