Problem/Motivation
Placing a block that returns NULL will triggerTypeError: Argument 1 passed to Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() must be of the type array, null given, called in /app/web/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php on line 110 in Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() (line 149 of /app/web/core/lib/Drupal/Core/Cache/CacheableMetadata.php)
BlockPluginInterface::build()
is documented as always returning an array, but was written before PHP7 allowed for strict return types.
Proposed resolution
Adding an assert() here improves debugability
Remaining tasks
None
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A