Skip to content
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

Fix off by one error and unhandled undefined in relay-listener #465

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

goseid
Copy link
Contributor

@goseid goseid commented Jul 13, 2022

While trying to get relays configured properly and working on a fresh system I came across a state where ProcessTallyData was calling getRelayGroupById with a deviceId that didn't match any of the relay groups. The for loop in getRelayGroupById went through 5 of my 4 relay groups which resulted in comparing the deviceId property on an undefined item from the array and errored out.

After fixing the off by one, the getRelayGroupById function was returning undefined due to the deviceId not matching any groups and ProcessTallyData errored out when trying to compare property deviceId on undefined.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello there goseid 👋

Thank you for opening your first PR for the Tally Arbiter project!

We will review it soon!

TallyArbiter fosters an open and welcoming environment for all our contributors. Please adhere to our Code Of Conduct.

@josephdadams
Copy link
Owner

Good catch! Thank you!

@josephdadams josephdadams merged commit b9b899d into josephdadams:master Jul 13, 2022
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.

2 participants