From 2835ecd82d2821d86a082366aa9b73f4d6df10a7 Mon Sep 17 00:00:00 2001 From: emiel Date: Fri, 27 Feb 2009 22:39:17 +0000 Subject: [PATCH] Fix warning: instance variable @ldap_controls not initialized --- lib/net/ldap/pdu.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/net/ldap/pdu.rb b/lib/net/ldap/pdu.rb index c47735e..b0477ff 100644 --- a/lib/net/ldap/pdu.rb +++ b/lib/net/ldap/pdu.rb @@ -87,6 +87,7 @@ def initialize ber_object # So it makes more sense just to grab the bottom five bits. #@app_tag = ber_object[1].ber_identifier - 0x60 @app_tag = ber_object[1].ber_identifier & 31 + @ldap_controls = [] rescue # any error becomes a data-format error raise LdapPduError.new( "ldap-pdu format error" ) @@ -144,7 +145,7 @@ def result_code code = :resultCode # Return RFC-2251 Controls if any. # Messy. Does this functionality belong somewhere else? def result_controls - @ldap_controls || [] + @ldap_controls end # Return serverSaslCreds, which are only present in BindResponse packets.