From a644af0e0758e0bb70b12c2566190faaff8253ed Mon Sep 17 00:00:00 2001 From: Yotam Tanay Date: Tue, 3 Jan 2017 16:12:15 +0200 Subject: [PATCH] Fix error where address is null in _get_host_info (#506) * Fix error where address is null in _get_host_info * Bump CI --- elasticsearch/transport.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elasticsearch/transport.py b/elasticsearch/transport.py index fa494fb7..70715f27 100644 --- a/elasticsearch/transport.py +++ b/elasticsearch/transport.py @@ -219,8 +219,8 @@ class Transport(object): host = {} address = host_info.get('http', {}).get('publish_address') - # malformed address - if ':' not in address: + # malformed or no address given + if not address or ':' not in address: return None host['host'], host['port'] = address.rsplit(':', 1)