Fix indexing into an empty array

Signed-off-by: elelel <elelel@3wh.net>
This commit is contained in:
elelel
2021-10-16 23:00:17 +00:00
committed by Gerwin Klein
parent 526206aabe
commit be34e323e5

View File

@@ -58,7 +58,7 @@ def main(parse_args):
file_stack.append(header)
else:
# popped back up to an earlier header
while file_stack[-1] != header:
while (len(file_stack) > 0) and (file_stack[-1] != header):
file_stack.pop()
return 0