eca_trigger_content_entity_custom_event should handle entity being NULL
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3278067. --> Reported by: [jurgenhaas](https://www.drupal.org/user/168924) Related to !170 !137 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When <code>\Drupal\eca_content\Plugin\Action\TriggerContentEntityCustomEvent::execute</code> is called without an entity being available, this throws an exception:</p> <pre>TypeError: Argument 1 passed to Drupal\eca_content\Event\ContentEntityCustomEvent::__construct() must implement interface Drupal\Core\Entity\ContentEntityInterface, null given, called in /var/www/html/web/modules/contrib/eca/modules/content/src/Plugin/Action/TriggerContentEntityCustomEvent.php on line 53 in /var/www/html/web/modules/contrib/eca/modules/content/src/Event/ContentEntityCustomEvent.php on line 50 #0 /var/www/html/web/modules/contrib/eca/modules/content/src/Plugin/Action/TriggerContentEntityCustomEvent.php(53): Drupal\eca_content\Event\ContentEntityCustomEvent-&gt;__construct()<br>#1 /var/www/html/web/modules/contrib/eca/src/Entity/Objects/EcaAction.php(98): Drupal\eca_content\Plugin\Action\TriggerContentEntityCustomEvent-&gt;execute()<br>#2 /var/www/html/web/modules/contrib/eca/src/Processor.php(178): Drupal\eca\Entity\Objects\EcaAction-&gt;execute()</pre><p>This may happen e.g. if the entity being provided is the result of a views query which resulted in zero results, then this will be called with NULL as the entity. This should then just do nothing. We also need a test for this.</p> > Related issue: [Issue #3238629](https://www.drupal.org/node/3238629) > Related issue: [Issue #3238206](https://www.drupal.org/node/3238206)
issue