fix fetch() message 'ending' for multiple messages

fork
Brian White 12 years ago
parent 15a8077d16
commit b4051174df

@ -228,10 +228,10 @@ ImapConnection.prototype.connect = function(loginCb) {
function emitMsgEnd(key) { function emitMsgEnd(key) {
var fetches = requests[0].fetchers[key]; var fetches = requests[0].fetchers[key];
for (var i=0, len=fetches.length; i<len; ++i) { for (var i=0, len=fetches.length; i<len; ++i) {
if (fetches[i]._msg._ended) if (fetches[i]._msg) {
continue; fetches[i]._msg.emit('end');
fetches[i]._msg.emit('end'); fetches[i]._msg = undefined;
fetches[i]._msg._ended = true; }
} }
} }

Loading…
Cancel
Save