Skip to content

Commit 2835ecd

Browse files
author
emiel
committed
Fix warning: instance variable @ldap_controls not initialized
1 parent d6e6a97 commit 2835ecd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/net/ldap/pdu.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def initialize ber_object
8787
# So it makes more sense just to grab the bottom five bits.
8888
#@app_tag = ber_object[1].ber_identifier - 0x60
8989
@app_tag = ber_object[1].ber_identifier & 31
90+
@ldap_controls = []
9091
rescue
9192
# any error becomes a data-format error
9293
raise LdapPduError.new( "ldap-pdu format error" )
@@ -144,7 +145,7 @@ def result_code code = :resultCode
144145
# Return RFC-2251 Controls if any.
145146
# Messy. Does this functionality belong somewhere else?
146147
def result_controls
147-
@ldap_controls || []
148+
@ldap_controls
148149
end
149150

150151
# Return serverSaslCreds, which are only present in BindResponse packets.

0 commit comments

Comments
 (0)