Twitter: catch ValueError if the provided index isn't a number at all
This commit is contained in:
parent
ad4d75f724
commit
9745cfc9be
@ -138,12 +138,17 @@ class Twitter(Module):
|
|||||||
user = match.group(1)
|
user = match.group(1)
|
||||||
index = match.group(2)
|
index = match.group(2)
|
||||||
|
|
||||||
if index:
|
try:
|
||||||
index = int(index)
|
if index:
|
||||||
if index > 0:
|
index = int(index)
|
||||||
|
if index > 0:
|
||||||
|
index = 0
|
||||||
|
else:
|
||||||
index = 0
|
index = 0
|
||||||
else:
|
except ValueError as e:
|
||||||
|
print('Couldn\'t convert index: ' + str(e))
|
||||||
index = 0
|
index = 0
|
||||||
|
|
||||||
count = (-1*index) + 1
|
count = (-1*index) + 1
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user