Skip to content

Commit defce31

Browse files
committed
don't crash on text() w/ width & empty string
1 parent eade22e commit defce31

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

plotdevice/gfx/text.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def _dedent(cls, attrib_txt, idx=0, inherit=False):
262262
263263
Note that this method *modifies* the attrib_txt reference rather than returning a value.
264264
"""
265+
if not attrib_txt.length(): return
265266
attrib_txt.beginEditing()
266267
old_graf, _ = attrib_txt.attribute_atIndex_effectiveRange_("NSParagraphStyle", idx, None);
267268
graf = old_graf.mutableCopy()

0 commit comments

Comments
 (0)