Skip to content

Commit

Permalink
Fix undefined method 'to_ber' for nil:NilClass. Convert unless nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Tobias Skjong-Børsting committed Jan 26, 2011
1 parent 5bc73d3 commit aeda402
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net/ldap.rb
Expand Up @@ -1470,7 +1470,7 @@ def modify(args)
# TODO, fix the following line, which gives a bogus error if the
# opcode is invalid.
op_1 = { :add => 0, :delete => 1, :replace => 2 }[op.to_sym].to_ber_enumerated
modify_ops << [op_1, [attr.to_s.to_ber, Array(values).map { |v| v.to_ber}.to_ber_set].to_ber_sequence].to_ber_sequence
modify_ops << [op_1, [attr.to_s.to_ber, Array(values).map { |v| v.to_ber unless v.nil? }.to_ber_set].to_ber_sequence].to_ber_sequence
}

request = [modify_dn.to_ber,
Expand Down

0 comments on commit aeda402

Please sign in to comment.