Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: properly handle the case when an element's text is None #3995

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

Conversation

badGarnet
Copy link
Collaborator

@badGarnet badGarnet commented May 5, 2025

Some elements, like Image, can have None as its text attribute's value. In that case current chunking logic fails because it expects the field to always have a length or can be split. The fix is to update the logic as element.text or "" for checking length and add flow control to early exit to avoid calling split on None.

@badGarnet badGarnet marked this pull request as ready for review May 5, 2025 17:33
Copy link
Contributor

@ryannikolaidis ryannikolaidis left a comment

Choose a reason for hiding this comment

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

yes please!

@badGarnet badGarnet enabled auto-merge May 5, 2025 17:41
@badGarnet badGarnet added this pull request to the merge queue May 5, 2025
Merged via the queue into main with commit b814ece May 5, 2025
43 checks passed
@badGarnet badGarnet deleted the fix/fix-chunking-with-elements-with-no-text-attribute branch May 5, 2025 18:42
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