Skip to content

Commit

Permalink
Make sure we have a registry before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonascalves committed Jun 2, 2023
1 parent 79c38ef commit 26d0dc5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Schema/Types/BlockTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ public function __construct() {

$registry = Registry::get_registry();

if ( empty( $registry ) || ! is_array( $registry ) ) {
return;
}

foreach ( $registry as $block_name => $block_type ) {
$type_names[] = self::register_block_type( $block_type, $type_registry );
}
Expand Down

0 comments on commit 26d0dc5

Please sign in to comment.