Skip to content

Commit

Permalink
fix(block): Check if the template is an array before doing `Arr::has(…
Browse files Browse the repository at this point in the history
…)` (#174)
  • Loading branch information
Log1x authored Jul 29, 2023
1 parent 574b090 commit 0e7d53c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function getStyle()
public function getTemplate($template = [])
{
return collect($template)->map(function ($value, $key) {
if (Arr::has($value, 'innerBlocks')) {
if (is_array($value) && Arr::has($value, 'innerBlocks')) {
$innerBlocks = collect($value['innerBlocks'])->map(function ($innerBlock) {
return $this->getTemplate($innerBlock)->all();
})->collapse();
Expand Down

0 comments on commit 0e7d53c

Please sign in to comment.