Skip to content

Commit 31a8b18

Browse files
cnamquiGamerGirlandCo
authored andcommitted
issue-149 add null check to second pass of list block instead of non null assertion
1 parent f7f918b commit 31a8b18

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index/import/markdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export function markdownSourceImport(
188188
// In the second list pass, actually construct the list heirarchy.
189189
for (const item of listItems.values()) {
190190
if (item.parentLine < 0) {
191-
const listBlock = blocks.getPairOrNextHigher(-item.parentLine - 1)![1];
191+
const listBlock = blocks.getPairOrNextHigher(-item.parentLine - 1)?.[1];
192192
if (!listBlock || !(listBlock.type === "list")) continue;
193193

194194
(listBlock as ListBlockData).items.push(item);

0 commit comments

Comments
 (0)