From f93df2fd49c086e5f71261ec008eab7d7b33bd04 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 27 Feb 2021 20:55:38 +0100 Subject: [PATCH] Avoid the loop on the Zeroconf addresses object if the object is None (e.g. in the context of some tests) --- platypush/plugins/zeroconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platypush/plugins/zeroconf.py b/platypush/plugins/zeroconf.py index cdbc30e42..1305ab0d5 100644 --- a/platypush/plugins/zeroconf.py +++ b/platypush/plugins/zeroconf.py @@ -25,7 +25,7 @@ class ZeroconfListener(zeroconf.ServiceListener): @staticmethod def parse_service_info(info: ServiceInfo) -> dict: return { - 'addresses': [socket.inet_ntoa(addr) for addr in info.addresses if info and info.addresses], + 'addresses': [socket.inet_ntoa(addr) for addr in info.addresses if info.addresses] if info else [], 'port': info.port, 'host_ttl': info.host_ttl, 'other_ttl': info.other_ttl,