Skip to content

Commit aeda402

Browse files
author
Lars Tobias Skjong-Børsting
committed
Fix undefined method 'to_ber' for nil:NilClass. Convert unless nil.
1 parent 5bc73d3 commit aeda402

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/net/ldap.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ def modify(args)
14701470
# TODO, fix the following line, which gives a bogus error if the
14711471
# opcode is invalid.
14721472
op_1 = { :add => 0, :delete => 1, :replace => 2 }[op.to_sym].to_ber_enumerated
1473-
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
1473+
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
14741474
}
14751475

14761476
request = [modify_dn.to_ber,

0 commit comments

Comments
 (0)