From c8b0f75ea1b7af99c4180a6ccede832929da88f2 Mon Sep 17 00:00:00 2001 From: srisri332 Date: Mon, 18 Dec 2023 09:58:21 +0530 Subject: [PATCH] MM-52722: Fixed error when accessing property on undefined --- .../src/components/live-markdown-plugin/liveMarkdownPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/components/live-markdown-plugin/liveMarkdownPlugin.ts b/webapp/src/components/live-markdown-plugin/liveMarkdownPlugin.ts index afcb2bd02..42b03a899 100644 --- a/webapp/src/components/live-markdown-plugin/liveMarkdownPlugin.ts +++ b/webapp/src/components/live-markdown-plugin/liveMarkdownPlugin.ts @@ -180,7 +180,7 @@ const maintainInlineStyles = ( // If enter was pressed (or the block was otherwise split) we must maintain // styles in the previous block as well - if (lastChangeType === 'split-block') { + if (lastChangeType === 'split-block' && contentState.getBlockBefore(blockKey) !== undefined) { const newPrevBlock = mapInlineStyles( contentState.getBlockBefore(blockKey)!, inlineStyleStrategies,