From a14a6547dd5c5641e0b0a7a0420060cb631eb4f8 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 1 Sep 2022 15:43:59 +0200 Subject: [PATCH] Fix uninitialized instance variable warning --- lib/toxiproxy.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/toxiproxy.rb b/lib/toxiproxy.rb index 2228dba..8434545 100644 --- a/lib/toxiproxy.rb +++ b/lib/toxiproxy.rb @@ -225,13 +225,10 @@ def toxics } end + @http = nil def self.reset_http_client! - if defined? @http - @http.finish() if @http && @http.started? - @http = nil - end - - @http + @http.finish if @http&.started? + @http = nil end private