protecting against blank outputs

This commit is contained in:
Ty Dunn 2023-06-15 23:09:05 -07:00
parent ae469f2028
commit 12dc5b82cc

View file

@ -344,6 +344,7 @@ def get_python_traceback(output: str) -> str:
def get_javascript_traceback(output: str) -> str:
lines = output.splitlines("\n")
first_line = lines[0].split(": ")
if len(lines) > 0 and len(first_line[0]) > 0 and "at" in lines[1].lstrip():
if len(lines) == 0:
first_line = lines[0].split(": ")
if len(lines) > 1 and len(first_line) > 0 and len(first_line[0]) > 0 and "at" in lines[1].lstrip():
return output