lib/grumlin/client.rb in grumlin-0.6.0 vs lib/grumlin/client.rb in grumlin-0.6.1
- old
+ new
@@ -47,11 +47,13 @@
close
end
end
def close
- @transport.close
- raise ResourceLeakError, "Request list is not empty: #{requests}" if @request_dispatcher.requests.any?
+ @transport&.close
+ if @request_dispatcher&.requests&.any?
+ raise ResourceLeakError, "Request list is not empty: #{@request_dispatcher.requests}"
+ end
reset!
end
def connected?