Skip to content

Commit

Permalink
Fix issue with streams have no name
Browse files Browse the repository at this point in the history
In the scenario where stats are being obtained, but no stream name is defined (e.g. Icecast in relay slave mode, relays-on-demand enabled).

We now catch the error thrown. General error catching needs to be implemented.
  • Loading branch information
Matt Ribbins committed Mar 22, 2018
1 parent 94db7c5 commit 44f7f05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion icecast2_all
Expand Up @@ -72,7 +72,10 @@ def ic2xml():
mount = source.getAttribute("mount")
listeners = int(source.getElementsByTagName("listeners")[0].firstChild.nodeValue)
listeners = round(listeners)
name = source.getElementsByTagName("server_name")[0].firstChild.nodeValue
try:
name = source.getElementsByTagName("server_name")[0].firstChild.nodeValue
except IndexError:
name = mount
mount = mount.replace("-", "_").replace(".", "_")
sourcelist[mount[1:]] = (listeners, name)

Expand Down

0 comments on commit 44f7f05

Please sign in to comment.