diff --git a/plugins/text-editor-resources/src/components/extension/toolbar/toolbar.ts b/plugins/text-editor-resources/src/components/extension/toolbar/toolbar.ts index 9405e844f80..cb7e1cc8e23 100644 --- a/plugins/text-editor-resources/src/components/extension/toolbar/toolbar.ts +++ b/plugins/text-editor-resources/src/components/extension/toolbar/toolbar.ts @@ -636,7 +636,7 @@ function resolveCursorPositionFromCoords (view: EditorView, coords: { left: numb function scanMarker (target: HTMLElement | null, field: string): [boolean, HTMLElement | null] { while (target != null) { - if (target.dataset[field] === 'true') { + if (target.dataset?.[field] === 'true') { return [true, target] } target = target.parentElement