From 2e9db2eca5bbc9c32ed1c1e398309332b2a24188 Mon Sep 17 00:00:00 2001 From: James Westman Date: Sun, 24 Dec 2023 21:40:45 -0600 Subject: [PATCH] errors: Fix bug when compiling empty file --- blueprintcompiler/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blueprintcompiler/errors.py b/blueprintcompiler/errors.py index 773122a..73fd45d 100644 --- a/blueprintcompiler/errors.py +++ b/blueprintcompiler/errors.py @@ -93,7 +93,7 @@ class CompileError(PrintableError): assert self.range is not None line_num, col_num = utils.idx_to_pos(self.range.start + 1, code) - line = code.splitlines(True)[line_num] + line = code.splitlines(True)[line_num] if code != "" else "" # Display 1-based line numbers line_num += 1