AvianFlu/ntwitter — Issue #11: Object.keys called on non-object
Author: preziusoftware
Created: 2011-10-08 11:35:39+00:00
State: open

Using this context:
NodeJS 0.4.12 on 2.6.35.14-97.fc14.x86_64

NodeJS server crashes on

/usr/local/node/lib/node_modules/ntwitter/lib/twitter.js:204
Object.keys(params).forEach(function(item) {
^
TypeError: Object.keys called on non-object
at Function.keys (native)
at Twitter.stream (/usr/local/node/lib/node_modules/ntwitter/lib/twitter.js:204:10)
at s (**********************)
at Query. (/usr/local/node/lib/node_modules/mysql/lib/client.js:108:11)
at Query.emit (events.js:61:17)
at Query._handlePacket (/usr/local/node/lib/node_modules/mysql/lib/query.js:51:14)
at Client._handlePacket (/usr/local/node/lib/node_modules/mysql/lib/client.js:312:14)
at Parser. (native)
at Parser.emit (events.js:64:17)
at /usr/local/node/lib/node_modules/mysql/lib/parser.js:71:14

I "fixed it" using the old code...
if (Array.isArray(params)) {
params.forEach(function (item) {
params[item] = params[item].join(',');
});
}

Any idea of what's goin' on?