Skip to content

Commit 0e12f74

Browse files
set_text_color: check if label is None before assigning value
Make sure label of text is set before changing its color property. Fixes: adafruit#29
1 parent d65f1ad commit 0e12f74

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_portalbase/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ def set_text_color(self, color, index=0):
307307
if self._text[index]:
308308
color = self.html_color_convert(color)
309309
self._text[index]["color"] = color
310-
self._text[index]["label"].color = color
310+
if self._text[index]["label"] is not None:
311+
self._text[index]["label"].color = color
311312

312313
def exit_and_deep_sleep(self, sleep_time):
313314
"""

0 commit comments

Comments
 (0)