From 075b589211e3757fc4fd81509eea9fa040a61472 Mon Sep 17 00:00:00 2001 From: Kyle Purkiss Date: Wed, 14 Apr 2021 15:47:04 -0700 Subject: [PATCH] Add safe navigation operator to handle case when proxy key exists but has a value of 'nil' --- lib/excon/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/excon/utils.rb b/lib/excon/utils.rb index 5130839b..550b9135 100644 --- a/lib/excon/utils.rb +++ b/lib/excon/utils.rb @@ -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