Skip to content

adafruit_portalbase: set_text_color hits exception when label is None #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
flavio-fernandes opened this issue Apr 10, 2021 · 0 comments · Fixed by #30
Closed

adafruit_portalbase: set_text_color hits exception when label is None #29

flavio-fernandes opened this issue Apr 10, 2021 · 0 comments · Fixed by #30

Comments

@flavio-fernandes
Copy link
Contributor

When trying to use code from https://learn.adafruit.com/matrix-portal-new-guide-scroller/code-the-matrix-portal
I hit the following exception:

code.py output:
Preloading font glyphs: 0123456789
obtaining time from adafruit.io server...
Connecting to AP ffiot
Getting time from IP address
New Hour, fetching new data...
Retrieving data...Obtaining guide info for guide 0...
Guide Title Adafruit Neo Trinkey
Traceback (most recent call last):
  File "code.py", line 104, in <module>
  File "code.py", line 77, in get_guide_info
  File "adafruit_portalbase/__init__.py", line 310, in set_text_color
AttributeError: 'NoneType' object cannot assign attribute 'color'

That is happening because self._text[index]["label"] may be None and code is not accounting for that.

flavio-fernandes added a commit to flavio-fernandes/Adafruit_CircuitPython_PortalBase that referenced this issue Apr 10, 2021
Make sure label of text is set before changing its color property.

Fixes: adafruit#29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant