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

Fixed an IndexError: list assignment index out of range error in RichTextField coersion #52

Merged

Conversation

peter-bertuglia
Copy link
Contributor

Fixed an IndexError: list assignment index out of range error in RichTextField._coerce_block, which was due to removing items by index from the front of a list causing the indexes to no longer be valid.

If you have a list: ['a', 'b', 'c'] and you want to remove the values at indexes 1 and 2, if you remove the value at index 1, then the list size shrinks by one and the index 2 is outside of the list. My fix just does the trimming from the end of the list, so the indexes are still consistent with the size of the list at the time they are removed.

…chTextField._coerce_block due to removing items by index from a list from the front causing the indexes to no longer be valid.
@dlitvakb
Copy link
Contributor

Thanks for fixing this!

Merging!

Cheers

@dlitvakb dlitvakb merged commit 99a574e into contentful:master Oct 11, 2019
@peter-bertuglia peter-bertuglia deleted the fix_rtf_remove_indexes_in_coerce_block branch October 11, 2019 15:57
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.

None yet

2 participants