From 94a65e5d8fbe8920c20061c536b6fb492f2695c1 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Sat, 28 Jul 2018 23:25:13 -0400 Subject: [PATCH] more --- txupnp/gateway.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/txupnp/gateway.py b/txupnp/gateway.py index e167a74..2067d03 100644 --- a/txupnp/gateway.py +++ b/txupnp/gateway.py @@ -54,14 +54,15 @@ class RootDevice(object): log.exception("failed to decode xml") log.error(xml_string) log.info(binascii.hexlify(xml_string)) - return + root = {} self.spec_version = root.get(SPEC_VERSION) - self.url_base = root["URLBase"] + self.url_base = root.get("URLBase") self.devices = [] self.services = [] - root_device = Device(self, **(root["device"])) - self.devices.append(root_device) - log.info("finished setting up root device. %i devices and %i services", len(self.devices), len(self.services)) + if root: + root_device = Device(self, **(root["device"])) + self.devices.append(root_device) + log.info("finished setting up root device. %i devices and %i services", len(self.devices), len(self.services)) class Gateway(object):