rendering: fix crash on empty pages

This commit is contained in:
dece 2021-05-07 21:54:09 +02:00
parent 6b0a622017
commit b26dad0d0d

View file

@ -24,7 +24,7 @@ def render_lines(metalines, window, max_width):
dimensions of the resized window. dimensions of the resized window.
""" """
num_lines = len(metalines) num_lines = len(metalines)
new_dimensions = num_lines, max_width new_dimensions = max(num_lines, 1), max_width
window.resize(*new_dimensions) window.resize(*new_dimensions)
for line_index, metaline in enumerate(metalines): for line_index, metaline in enumerate(metalines):
try: try: