Fatal error when building BlockContent
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3279218. -->
Reported by: [baysaa](https://www.drupal.org/user/1358394)
Related to !18
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When trying to output a Block Content through PEVB plugin, the page produces a fatal error:</p>
<blockquote><p>TypeError: Argument 2 passed to Drupal\Core\Entity\EntityViewBuilder::addContextualLinks() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/www/html/web/modules/contrib/pluggable_entity_view_builder/src/EntityViewBuilderTrait.php on line 52 in Drupal\Core\Entity\EntityViewBuilder->addContextualLinks() (line 355 of /var/www/html/web/core/lib/Drupal/Core/Entity/EntityViewBuilder.php) </p></blockquote>
<p>There doesn't seem to be sufficient checks to ensure we have an actual entity before passing it to methods which expect an entity</p>
issue