mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
errors: Fix bug when compiling empty file
This commit is contained in:
parent
a8c6d5d342
commit
2e9db2eca5
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue