prevent size calculaion exception on empty index

jsonpath_ng
Hartmut Holzgraefe 2023-01-15 20:43:09 +01:00
rodzic 86e842d759
commit 65d084e5d8
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -853,9 +853,12 @@ class GeneralIndexRenderer:
font_desc)
#print "PREPARE", layout, fascent, fheight, em
if len(text_lines):
width = max(map(lambda x: self._label_width(layout, x), text_lines))
# Save some extra space horizontally
width += n_em_padding * em
else:
width = 0
height = fheight * len(text_lines)