Check the length of the line before indexing

This commit is contained in:
Val 2022-08-14 23:08:50 -05:00
parent 95162fdb72
commit 717a645d9d

View File

@ -13,7 +13,7 @@ def hash(byts):
while True:
try:
line = input("> ")
if (line[0] == '~'):
if (len(line) and line[0] == '~'):
h = hash(bytes.fromhex(line[1:]));
else:
h = hash(line.encode())