Skip to content

Fix index error if datafields outnumber values #40

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

Merged
merged 4 commits into from
May 27, 2021

Conversation

makermelissa
Copy link
Collaborator

@makermelissa makermelissa requested a review from a team May 27, 2021 18:49
@@ -392,7 +392,7 @@ def _fill_text_labels(self, values):
if self._text:
value_index = 0 # In case values and text is not the same
for i in range(len(self._text)):
if not self._text[i]["is_data"]:
if not self._text[i]["is_data"] or value_index > len(values) - 1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wanna add some parens here?

@makermelissa makermelissa requested a review from ladyada May 27, 2021 19:40
@@ -392,7 +392,7 @@ def _fill_text_labels(self, values):
if self._text:
value_index = 0 # In case values and text is not the same
for i in range(len(self._text)):
if not self._text[i]["is_data"]:
if not self._text[i]["is_data"] or (value_index > len(values) - 1):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (not self._text[i]["is_data"]) or (value_index > (len(values) - 1)):

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, thanks

@@ -392,7 +392,7 @@ def _fill_text_labels(self, values):
if self._text:
value_index = 0 # In case values and text is not the same
for i in range(len(self._text)):
if not self._text[i]["is_data"] or (value_index > len(values) - 1):
if (not self._text[i]["is_data"]) or (value_index > len(values) - 1):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more!
if (not self._text[i]["is_data"]) or (value_index > (len(values) - 1)):

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thanks

@makermelissa makermelissa merged commit 9d18093 into adafruit:main May 27, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 28, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.7.1 from 1.7.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#40 from makermelissa/main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bitcoin Matrix Display error - list index out of range
2 participants