christkv/node-mongodb-native — Issue #384: TypeError in cursor.nextObject()
Author: skenqbx
Created: 2011-10-27 17:09:15+00:00
State: open

Hello, i get the following error when using `cursor.nextObject(...)` on a tailable cursor

TypeError: Cannot read property 'length' of null
at [object Object].nextObject (.../node_modules/mongodb/lib/mongodb/cursor.js:483:23)

I looked it up, and it seems that cursor.js:668

self.items = null;

is the problem. Changing it to

self.items = [ ];

solves the problem. This also happens when using `cursor.nextObject(...)` with a non-tailable cursor.

node-mongodb-native v0.9.6-23
node.js master branch 173f91c7918f8c5f7c23ba3bfb2a56eb2e1b2814

Thanks in advance