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: deleteText currPos left and right both null #505

Closed
wants to merge 1 commit into from

Conversation

rcbevans
Copy link

@rcbevans rcbevans commented Feb 23, 2023

Handle the case where both `currPos.left` and `currPos.right` are null in `YText::deleteText` to prevent error `Cannot read properties of null (reading 'parent')` .

Fixes yjs#504.
@YuliaTsareva
Copy link

Any chance this PR will be merged? We also encounter issues with these lines of code.

@dmonad
Copy link
Member

dmonad commented Jun 9, 2024

I know other projects accept "quick fixes" that simply fix an issue, so we can move on for another week. But these kinds of fixes often cause more harm because they don't fix the underlying issue. I want to understand what's wrong first.

This is why I require a proper bug report before we can implement a fix. How can I reproduce this issue?
At least I need to know which Yjs method is called when this issue is called. An error stack would be nice and easy to produce.

This is not the right fix for the underlying issue, I'm sorry. It shouldn't be possible to create ItemTextListPosition in empty documents (left AND right is null). I don't understand how this error can occur. If you can create positions in empty documents with the Yjs API, then we are prone to other issues as well. I'd like to prevent creating positions in empty documents.

@dmonad dmonad closed this Jun 9, 2024
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

3 participants