Skip to content

Commit a644af0

Browse files
ytanayhonzakral
authored andcommitted
Fix error where address is null in _get_host_info (elastic#506)
* Fix error where address is null in _get_host_info * Bump CI
1 parent 8107bbc commit a644af0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

elasticsearch/transport.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ def _get_host_info(self, host_info):
219219
host = {}
220220
address = host_info.get('http', {}).get('publish_address')
221221

222-
# malformed address
223-
if ':' not in address:
222+
# malformed or no address given
223+
if not address or ':' not in address:
224224
return None
225225

226226
host['host'], host['port'] = address.rsplit(':', 1)

0 commit comments

Comments
 (0)