TypeError: Bad argument at CheckInput #4

Open
kldavis4 opened this Issue Aug 20, 2010 · 1 comment

Comments

Projects
None yet
2 participants
@kldavis4

I am having a problem reading data from a database. The table is just a date field and a string field with a JSON object in it. Depending on the date range I select the query returns the data correctly OR I get this error:

/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:283
var message = first.slice(5, 5 + length);
^
TypeError: Bad argument.
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:283:25)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)
at checkInput (/Users/kldavis/.node_libraries/postgres-js/postgres-pure.js:301:5)

I did a little bit of debugging and determined that the call 'int32read(1)' is returning NaN in this line:

function checkInput() {
if (queue.length === 0) { return; }
var first = queue[0];
var code = String.fromCharCode(first[0]);

var length = first.int32Read(1) - 4; <

I can possibly do some more work trying to figure what in the data is causing this to break, but there probably also needs to be a fix in checkInput to make it a little more robust.

@pdelanauze

This comment has been minimized.

Show comment
Hide comment
@pdelanauze

pdelanauze Sep 9, 2010

Same. Was able to reproduce this with 0.1.0 tag

Same. Was able to reproduce this with 0.1.0 tag

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