From 407a2ef6f27916098f3715e56a82f0311fb69601 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Mon, 9 Nov 2020 15:43:36 -0500 Subject: [PATCH] More SSDP Error handling --- fHDHR/device/ssdp.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fHDHR/device/ssdp.py b/fHDHR/device/ssdp.py index a38ce47..341ef3d 100644 --- a/fHDHR/device/ssdp.py +++ b/fHDHR/device/ssdp.py @@ -137,9 +137,12 @@ class SSDPServer(): elif cmd[0] == 'NOTIFY' and cmd[1] == '*': # SSDP presence self.logger.debug("NOTIFY data: {}".format(headers)) - if headers["server"].startswith("fHDHR"): - if headers["location"] != self.location: - self.detect_method.set(headers["location"].split("/device.xml")[0]) + try: + if headers["server"].startswith("fHDHR"): + if headers["location"] != self.location: + self.detect_method.set(headers["location"].split("/device.xml")[0]) + except KeyError: + return else: self.logger.debug('Unknown SSDP command %s %s' % (cmd[0], cmd[1]))