Skip to content

Commit

Permalink
bug fix Uncaught Exception in discover() 5kyc0d3r#17
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-pippin committed May 15, 2022
1 parent eb798af commit 8b5eaea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions upnpy/ssdp/SSDPDevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,15 @@ def _get_services_request(self):
root = minidom.parseString(self.description)

base_url = self.base_url

for service in root.getElementsByTagName('service'):
service_string = service.getElementsByTagName('serviceType')[0].firstChild.nodeValue
service_id = service.getElementsByTagName('serviceId')[0].firstChild.nodeValue
scpd_url = service.getElementsByTagName('SCPDURL')[0].firstChild.nodeValue
control_url = service.getElementsByTagName('controlURL')[0].firstChild.nodeValue
event_sub_url = service.getElementsByTagName('eventSubURL')[0].firstChild.nodeValue
control_url = None
event_sub_url = None
if service.getElementsByTagName('controlURL')[0].firstChild:
control_url = service.getElementsByTagName('controlURL')[0].firstChild.nodeValue
event_sub_url = service.getElementsByTagName('eventSubURL')[0].firstChild.nodeValue

parsed_service_id = utils.parse_service_id(service_id)

Expand Down

0 comments on commit 8b5eaea

Please sign in to comment.