Skip to content

Commit 3966bfe

Browse files
handled nil condition for Cookie Method in ruby
1 parent efe5a34 commit 3966bfe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: rb/lib/selenium/webdriver/remote/bridge.rb

+6
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,16 @@ def add_cookie(cookie)
385385
end
386386

387387
def delete_cookie(name)
388+
if ( name.nil? || name.empty?) then
389+
raise Error::ArgumentError, 'Cookie name cannot be null'
390+
end
388391
execute :delete_cookie, name: name
389392
end
390393

391394
def cookie(name)
395+
if ( name.nil? || name.empty?) then
396+
raise Error::ArgumentError, 'Cookie name cannot be null'
397+
end
392398
execute :get_cookie, name: name
393399
end
394400

0 commit comments

Comments
 (0)