Check argv length before using it

master
pictuga 2016-05-31 02:46:28 +02:00
parent 466d8e47d6
commit 4ff80cec86
1 changed files with 1 additions and 1 deletions

View File

@ -700,7 +700,7 @@ def main():
elif len(sys.argv) <= 1 or isInt(sys.argv[1]) or '--root' in sys.argv[1:]: elif len(sys.argv) <= 1 or isInt(sys.argv[1]) or '--root' in sys.argv[1:]:
# start internal (basic) http server # start internal (basic) http server
if isInt(sys.argv[1]): if len(sys.argv) > 1 and isInt(sys.argv[1]):
argPort = int(sys.argv[1]) argPort = int(sys.argv[1])
if argPort > 0: if argPort > 0:
port = argPort port = argPort