Skip to content

Fix unexpected error in getBlockElementAtNode.ts#1709

Merged
juliaroldi merged 1 commit into
masterfrom
u/juliaroldi/unexpected-error-block-element
Apr 6, 2023
Merged

Fix unexpected error in getBlockElementAtNode.ts#1709
juliaroldi merged 1 commit into
masterfrom
u/juliaroldi/unexpected-error-block-element

Conversation

@juliaroldi

Copy link
Copy Markdown
Contributor

If the head node or the tail node is undefined, the block element at node cannot be returned, so return null.

Fix for error:
Uncaught TypeError: Cannot read properties of undefined (reading 'parentNode');

Call stack:
at webpack://owa/packages/roosterjs-editor-dom/lib/blockElements/getBlockElementAtNode.ts:65
at webpack://owa/packages/roosterjs-editor-dom/lib/inlineElements/getInlineElementAtNode.ts:31
at webpack://owa/packages/roosterjs-editor-dom/lib/contentTraverser/BodyScoper.ts:39
at webpack://owa/packages/roosterjs-editor-dom/lib/contentTraverser/ContentTraverser.ts:146
at webpack://owa/packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/entityFeatures.ts:374
at webpack://owa/packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/entityFeatures.ts:337
at webpack://owa/packages/roosterjs-editor-plugins/lib/plugins/ContentEdit/features/entityFeatures.ts:237
at webpack://owa/packages/roosterjs-editor-core/lib/corePlugins/EditPlugin.ts:86

@juliaroldi juliaroldi changed the title Fix unexpected error Fix unexpected error in getBlockElementAtNode.ts Apr 6, 2023
@juliaroldi
juliaroldi merged commit 566a1d3 into master Apr 6, 2023
@JiuqingSong
JiuqingSong deleted the u/juliaroldi/unexpected-error-block-element branch September 8, 2023 22:33
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