From 26d0dc5446ecd4be48da384ab79147dc1e656dd9 Mon Sep 17 00:00:00 2001 From: Renato Alves <19148962+renatonascalves@users.noreply.github.com> Date: Thu, 1 Jun 2023 22:04:50 -0300 Subject: [PATCH] Make sure we have a registry before using it --- src/Schema/Types/BlockTypes.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Schema/Types/BlockTypes.php b/src/Schema/Types/BlockTypes.php index f5aeba72..dd58c462 100644 --- a/src/Schema/Types/BlockTypes.php +++ b/src/Schema/Types/BlockTypes.php @@ -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 ); }