Skip to content

Commit

Permalink
fix: prev might be undefined (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeniau committed Feb 4, 2024
1 parent 2015673 commit 520a86d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/syntax/inline-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const MarkdownItInlineProps: MarkdownIt.PluginWithOptions<MdcInlinePropsO
return

const prev = tokens[index - 1]
if (prev.type !== 'mdc_block_open' || prev.tag !== 'ul')
if (!prev || prev.type !== 'mdc_block_open' || prev.tag !== 'ul')
return

// find the matching close token
Expand Down

0 comments on commit 520a86d

Please sign in to comment.