Skip to content

Commit c332019

Browse files
fix: array-key
1 parent d954477 commit c332019

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Parser/EditorjsParser.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ private function render(): void
7373
throw new Exception('No Blocks to parse !');
7474
}
7575
foreach ($this->data->blocks as $block) {
76-
if (in_array($block->type, $this->parser)) {
76+
if (array_key_exists($block->type, $this->parser)) {
7777
$this->dom->appendChild(
7878
$this->parser[$block->type]->parseBlock($this->html5, $this->dom, $block, $this->prefix)
7979
);
80+
} else {
81+
throw new Exception('Not parseable type: ' . $block->type . '!');
8082
}
8183
}
8284
}

0 commit comments

Comments
 (0)