Getting a null parser after an error #74

Open
ghost opened this Issue Mar 5, 2012 · 1 comment

Projects

None yet

1 participant

@ghost

...\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
});

@prystupa

+1 I'm getting this one too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment