Label init with max_glyphs instead of text value is broken
flavio-fernandes opened this issue · 0 comments
flavio-fernandes commented
When Label class is initialized with size instead of text.
The split function is attempted in None object instead of an empty string.
That will cause this:
File "/lib/adafruit_display_text/label.py", line 84, in __init__
AttributeError: 'NoneType' object has no attribute 'split'
This is code with this issue (look at lines 78 ans 84):
Adafruit_CircuitPython_Display_Text/adafruit_display_text/label.py
Lines 78 to 84 in 5934db7
To reproduce, simply create a Label like this:
import terminalio
from adafruit_display_text import label
text_area = label.Label(terminalio.FONT, max_glyphs=10)
This used to work, so I suspect it is a regression introduced here:
2b4f1ad