Skip to content

Commit

Permalink
Add null check to prevent errors in get_block_template filter (#60491)
Browse files Browse the repository at this point in the history
  • Loading branch information
okmttdhr authored and fullofcaffeine committed Apr 16, 2024
1 parent c51c9dc commit 5ae8105
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/compat/wordpress-6.6/resolve-patterns.php
Expand Up @@ -64,6 +64,9 @@ function gutenberg_replace_pattern_blocks_get_block_templates( $templates ) {
}

function gutenberg_replace_pattern_blocks_get_block_template( $template ) {
if ( null === $template ) {
return $template;
}
$blocks = parse_blocks( $template->content );
$blocks = gutenberg_replace_pattern_blocks( $blocks );
$template->content = serialize_blocks( $blocks );
Expand Down

0 comments on commit 5ae8105

Please sign in to comment.