Fix crash if user does not give a stream id
This commit is contained in:
parent
336822236c
commit
ae8b5e1992
1 changed files with 6 additions and 4 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue