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

model.Range#getTransformedByDelta fails if operation.howMany is 0 #4314

Closed
scofalik opened this issue Mar 14, 2018 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1361 or ckeditor/ckeditor5-engine#1359
Assignees
Labels
package:engine type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@scofalik
Copy link
Contributor

There is a bug in model.Range#getTransformedByDelta method: https://github.com/ckeditor/ckeditor5-engine/blob/master/src/model/range.js#L402-L408

This bit of code tried to handle both MoveDelta (and all which extends it) and InsertDelta in a smart way. If there's no operation.howMany -- use operation.nodes.maxOffset. Unfortunately, in some edge cases, operation.howMany may equal 0. Then it crashes.

@scofalik scofalik self-assigned this Mar 14, 2018
pjasiun referenced this issue in ckeditor/ckeditor5-engine Mar 14, 2018
Fix: `model.Range#getTransformedByDelta` should not crash for `MoveDelta` which moves no nodes. Closes #1358.
@Reinmar Reinmar reopened this Mar 15, 2018
pjasiun referenced this issue in ckeditor/ckeditor5-engine Mar 15, 2018
Fix: `model.Range#getTransformedByDelta` should not crash for `MoveDelta` which moves no nodes. Closes #1358.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 15 milestone Oct 9, 2019
@mlewand mlewand added module:model type:bug This issue reports a buggy (incorrect) behavior. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment