Skip to content

Commit 56f3761

Browse files
authored
Merge pull request #2 from srisri332/MM-52722
MM-52722: Fixed error when accessing property on undefined
2 parents 05509b7 + c8b0f75 commit 56f3761

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webapp/src/components/live-markdown-plugin/liveMarkdownPlugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ const maintainInlineStyles = (
180180

181181
// If enter was pressed (or the block was otherwise split) we must maintain
182182
// styles in the previous block as well
183-
if (lastChangeType === 'split-block') {
183+
if (lastChangeType === 'split-block' && contentState.getBlockBefore(blockKey) !== undefined) {
184184
const newPrevBlock = mapInlineStyles(
185185
contentState.getBlockBefore(blockKey)!,
186186
inlineStyleStrategies,

0 commit comments

Comments
 (0)