ruby-net-ldap
ruby-net-ldap copied to clipboard
Guard against potential result_pdu nil in Net::LDAP::Connection#search
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.
My application has this error in production environment, any solution?
@zjuanma I haven't had time to work on this, but if you start a pull request, I'd be happy to review it.