mcavage/node-ldapjs — Issue #53: NotFilter throws exception during internal construction
Author: cwoelk
Created: 2012-01-24 14:51:21+00:00
State: open

When I tried to upgrade recently I ran into an issue with my filter. I tried to chase it down a bit and found that the contructor of the NotFilter expects an options object which the callee in filters/index.js in serializeTree(tree, filter) line 267 does not provide.

The filter option I am using is
filter: '(&(objectClass=person)(!(objectClass=shadowAccount)))'

The stacktrace is
2012-01-24 14:37:30Z TRACE - Client: ldap.eye:11 error event=TypeError: options (object) required
at new NotFilter (/Users/cwo/Node-Play/check-in/node_modules/ldapjs/lib/filters/not_filter.js:16:11)
at serializeTree (/Users/cwo/Node-Play/check-in/node_modules/ldapjs/lib/filters/index.js:267:17)
at /Users/cwo/Node-Play/check-in/node_modules/ldapjs/lib/filters/index.js:274:9
at Array.forEach (native)
at serializeTree (/Users/cwo/Node-Play/check-in/node_modules/ldapjs/lib/filters/index.js:273:21)
at _parseString (/Users/cwo/Node-Play/check-in/node_modules/ldapjs/lib/filters/index.js:341:3)
at Object.parseString (/Users/cwo/Node-Play/check-in/node_modules/ldapjs/lib/filters/index.js:471:12)
at Client.search (/Users/cwo/Node-Play/check-in/node_modules/ldapjs/lib/client.js:627:30)
at Client. (/Users/cwo/Node-Play/check-in/server.js:146:16)
at Client.emit (events.js:64:17)

I hope this helps to improve it even further as ldapjs is awesome ;)

Regards,
Carsten