ruby-net-ldap icon indicating copy to clipboard operation
ruby-net-ldap copied to clipboard

Guard against potential result_pdu nil in Net::LDAP::Connection#search

Open jch opened this issue 10 years ago • 2 comments

It's possible for result_pdu to be nil at https://github.com/ruby-ldap/ruby-net-ldap/blob/fd2d1ed62df1e65a50627b429bce7a49cd623b04/lib/net/ldap/connection.rb#L548. It's initially assigned on line 501, but only line 518 reassigns it. It's possible to get a nil if no SearchResult pdu's are seen. We should either raise an error or guard for the nil. Whoever picks this up should determine when this scenario can occur and include a failing test.

jch avatar Jan 14 '15 23:01 jch

My application has this error in production environment, any solution?

zjuanma avatar Oct 06 '15 13:10 zjuanma

@zjuanma I haven't had time to work on this, but if you start a pull request, I'd be happy to review it.

jch avatar Oct 06 '15 16:10 jch