Merge pull request #755 from nperez0111/check-case

fix: if there is not element to modify, throw an error
This commit is contained in:
Kevin Jahns
2025-12-20 14:46:20 +01:00
committed by GitHub

View File

@@ -736,7 +736,11 @@ export class AbstractType {
} else if (delta.$deleteOp.check(op)) {
deleteText(transaction, currPos, op.delete)
} else if (delta.$modifyOp.check(op)) {
/** @type {ContentType} */ (currPos.right?.content).type.applyDelta(op.value)
if (currPos.right) {
/** @type {ContentType} */ (currPos.right.content).type.applyDelta(op.value)
} else {
error.unexpectedCase()
}
currPos.formatText(transaction, /** @type {any} */ (this), 1, op.format || {})
} else {
error.unexpectedCase()