From dc5ed393d6c7d0fa7258d18c6dab43663a380759 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sat, 28 Jul 2018 23:56:48 -0400 Subject: [PATCH] fix it? --- txupnp/gateway.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/txupnp/gateway.py b/txupnp/gateway.py index 71dca38..fb5b4e4 100644 --- a/txupnp/gateway.py +++ b/txupnp/gateway.py @@ -81,9 +81,10 @@ class Gateway(object): log.info("querying %s", self.location) response = yield treq.get(self.location) response_xml = yield response.content() - self._device = RootDevice(response_xml) - if not self._device.devices or not self._device.services: - log.error("failed to parse device: \n%s", response_xml) + if response_xml: + self._device = RootDevice(response_xml) + if not self._device.devices or not self._device.services: + log.error("failed to parse device: \n%s", response_xml) @property def services(self):