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: while True:
try: try:
line = input("> ") line = input("> ")
if (line[0] == '~'): if (len(line) and line[0] == '~'):
h = hash(bytes.fromhex(line[1:])); h = hash(bytes.fromhex(line[1:]));
else: else:
h = hash(line.encode()) h = hash(line.encode())