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

List index out of range exception in get_adc_offsets #83

Closed
csatt opened this issue Oct 14, 2019 · 0 comments
Closed

List index out of range exception in get_adc_offsets #83

csatt opened this issue Oct 14, 2019 · 0 comments
Assignees
Labels

Comments

@csatt
Copy link
Owner

csatt commented Oct 14, 2019

If the adc_pairs_yymmdd_hh_mm_ss.csv file is corrupted such that there are fewer than two points, an exception is detected in get_adc_offsets:

IndexError: list index out of range

This would also occur for any other (anomalous) case where the adc_pairs list has fewer than two points.

The process_adc_values() method should check the length of the adc_pairs list to make sure it has at least two points to prevent this exception.

@csatt csatt added the bug label Oct 14, 2019
@csatt csatt self-assigned this Oct 14, 2019
csatt added a commit that referenced this issue Oct 14, 2019
get_adc_offsets: Check that at least two points exist in self.adc_pairs before proceeding. Return RC_NO_POINTS if not. Disambiguate the two identical error messages.
@csatt csatt closed this as completed Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant