Skip to content

Commit

Permalink
fix: block throwing undefined error
Browse files Browse the repository at this point in the history
Co-authored-by: daniel <[email protected]>
  • Loading branch information
zernonia and dirtydiesel46 committed Nov 1, 2024
1 parent a1cba58 commit 43eb4a5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@ const groupBlockContent = (blockMap: BlockMap) => {
let index = -1

Object.keys(blockMap).forEach((id) => {
blockMap[id].value.content?.forEach((blockId) => {
const blockType = blockMap[blockId]?.value?.type
const blockValue = blockMap[id]?.value
if (!blockValue?.content) return

blockValue.content.forEach((blockId) => {
const nestedBlock = blockMap[blockId]?.value
if (!nestedBlock) return

const blockType = nestedBlock.type

if (blockType && blockType !== lastType) {
index++
Expand Down

0 comments on commit 43eb4a5

Please sign in to comment.