postwait/node-amqp — Issue #74: Getting a null parser after an error
Author: tshrestha
Created: 2012-03-05 17:02:49+00:00
State: open

...\node_modules\amqp\amqp.js:833
parser.execute(data);
^
TypeError: Cannot call method 'execute' of null
at Connection. (C:\Users\tshrestha\GSMarquee\node-web\main\node_modules\amqp\amqp.js:833:12)
at Connection.emit (events.js:67:17)
at TCP.onread (net.js:347:14)

Looking at amqp.js
parser.onError = function(e) {
self.end();
self.emit("error", e);
self.emit("close");
parser = null;
};

self.addListener('end', function () {
self.end();
// in order to allow reconnects, have to clear the
// state.
parser = null;
});

So, the parser is reset to null on end or error. But somehow a 'data' event arrived afterwards:
self.addListener('data', function (data) {
parser.execute(data); //<--this is line #833
});