Fix crash if user does not give a stream id

This commit is contained in:
Florent 2013-08-14 11:28:19 +02:00
commit ae8b5e1992

View file

@ -83,10 +83,12 @@ class Radioob(ReplApplication):
if not _id:
print >>sys.stderr, 'This command takes an argument: %s' % self.get_command_help('play', short=True)
return 2
try:
_stream_id = int(_stream_id)
except ValueError:
_stream_id = 0
_stream_id = 0
if _stream_id:
try:
_stream_id = int(_stream_id)
except:
pass
radio = self.get_object(_id, 'get_radio', ['streams'])
if not radio: