Skip to content

Commit

Permalink
Add safe navigation operator to handle case when proxy key exists but…
Browse files Browse the repository at this point in the history
… has a value of 'nil'
  • Loading branch information
Conrimaceogain committed Apr 14, 2021
1 parent bbb5bd7 commit 075b589
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/excon/utils.rb
Expand Up @@ -50,7 +50,7 @@ def redact(datum)
if datum.has_key?(:password)
datum[:password] = REDACTED
end
if datum.has_key?(:proxy) && datum[:proxy].has_key?(:password)
if datum.has_key?(:proxy) && datum[:proxy]&.has_key?(:password)
datum[:proxy] = datum[:proxy].dup
datum[:proxy][:password] = REDACTED
end
Expand Down

1 comment on commit 075b589

@samlehman
Copy link
Contributor

@samlehman samlehman commented on 075b589 Apr 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Conrimaceogain I think this breaks when using ruby 2.2.5

#743

Please sign in to comment.