Corrected a problem with siblingsId throwing an IndexError #200
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An example of when this error is thrown can be seen in the test that I have added.
What is happening here is that the
range_length
is 7,end
is 7, andlen(document_reference)
is 14. That means thatend + range_length == len(document_references)
. That means that theelif
statement does not fire and it goes toelse
, which errors because it tries to calldocument_references[end + range_length]
, which would bedocument_references[14]
, which doesn't exist. This change should correct the problem.