Make sure cmd[1] exists before checking it

This commit is contained in:
jw 2017-10-28 23:57:03 -07:00 committed by GitHub
parent 4a73c75722
commit ed00dccd5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -160,6 +160,7 @@ class RedditNetwork(Network):
while '' in cmd:
cmd.remove('')
cmd[0] = cmd[0].strip(' \t\n\r')
if cmd[1]:
if cmd[0] == u'tip' and cmd[1][0:3] == u'/u/':
log_info("Subbing out /u/ from username")
cmd[1] = cmd[1][3:]