Skip to content

Commit

Permalink
Check str len before slicing
Browse files Browse the repository at this point in the history
  • Loading branch information
tangledhelix committed Dec 19, 2024
1 parent 45a69aa commit d4cdacb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/guiguts/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,6 @@ def process(line: str) -> None:
for line in to_lines:
rewrapped_para = "".join((rewrapped_para, line))
# If input paragraph did not have a terminating newline, output shouldn't
if paragraph[-1] != "\n":
if len(paragraph) and paragraph[-1] != "\n":
rewrapped_para = rewrapped_para.rstrip("\n")
return rewrapped_para

0 comments on commit d4cdacb

Please sign in to comment.