Browse files

Fix issue with streams have no name

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...
mattyribbo committed Mar 22, 2018
1 parent 94db7c5 commit 44f7f0546dc0086ff817cf568d42056fbffdb9ba
Showing with 4 additions and 1 deletion.
  1. +4 −1 icecast2_all
@@ -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
name = source.getElementsByTagName("server_name")[0].firstChild.nodeValue
except IndexError:
name = mount
mount = mount.replace("-", "_").replace(".", "_")
sourcelist[mount[1:]] = (listeners, name)

0 comments on commit 44f7f05

Please sign in to comment.