Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Undefined exception when creating control #46

Closed
jgagnet opened this issue Jan 9, 2012 · 6 comments
Closed

Undefined exception when creating control #46

jgagnet opened this issue Jan 9, 2012 · 6 comments

Comments

@jgagnet
Copy link

jgagnet commented Jan 9, 2012

I am getting an exception when doing a simple lookup. This is using the Java LdapTemplate provided by spring. The code look like this:

ldapTemplate.lookup("uid=julien,dc=foo,dc=com")

The fix can be to add
if (!value) value = "";
in the index.js on line 47

I am not sure if it's a problem with the Java implementation or ldapjs itself.

Regards,

Julien

@mcavage
Copy link
Contributor

mcavage commented Jan 9, 2012

Hi Julien,

Sounds good, but can you give me the offending ldapjs stack trace?

@mcavage
Copy link
Contributor

mcavage commented Jan 9, 2012

Oh, and what version are you using? There was a big controls refactoring a few weeks ago, and I put in a couple fixes last week; suspect this may already be fixe.d

@jgagnet
Copy link
Author

jgagnet commented Jan 9, 2012

Hi Mark,

Reading my comment I realised I missed a few details.

The stacktrace is:
2012-01-09 17:37:53Z ERROR - Server: Exception happened parsing for 127.0.0.1:57981: TypeError: Cannot call method 'toString' of undefined
at getControl (/Users/julien/ldapcouch/node_modules/ldapjs/lib/controls/index.js:51:22)
at SearchRequest.parse (/Users/julien/ldapcouch/node_modules/ldapjs/lib/messages/message.js:83:15)
at Parser.write (/Users/julien/ldapcouch/node_modules/ldapjs/lib/messages/parser.js:105:13)
at Socket. (/Users/julien/ldapcouch/node_modules/ldapjs/lib/server.js:425:16)
at Socket.emit (events.js:64:17)
at Socket._onReadable (net.js:678:14)
at IOWatcher.onReadable as callback

This is when calling:
value: value.toString('utf8')

I am running version 0.3.6 of ldapjs.

Thanks for your feedback,

Julien

@mcavage
Copy link
Contributor

mcavage commented Jan 9, 2012

Oh, yikes, that's ancient in node.js terms :) - Try it on 0.4.3 (that's the latest).

@jgagnet
Copy link
Author

jgagnet commented Jan 10, 2012

Hi Mark,

Try with 0.4.3 and it's all good. Thanks and apologies about raising this bug.

@jgagnet jgagnet closed this as completed Jan 10, 2012
@mcavage
Copy link
Contributor

mcavage commented Jan 10, 2012

Hi Julien, no worries - glad you're up and running now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants