Skip to content

Commit 280f43a

Browse files
committed
Fix an error when saving Vizy blocks containing Matrix fields with no blocks defined
1 parent 8a1c960 commit 280f43a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/helpers/Matrix.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public static function sanitizeMatrixContent($field, $content)
1717
return $block->handle;
1818
}, $field->blockTypeFields);
1919

20+
if (!is_array($content)) {
21+
$content = [];
22+
}
23+
2024
if (array_key_exists('blocks', $content)) {
2125
// Filter block types against those available
2226
$content['blocks'] = array_filter($content['blocks'], function ($block) use ($blockTypes) {

0 commit comments

Comments
 (0)