eca_trigger_content_entity_custom_event should handle entity being NULL
Problem/Motivation
When \Drupal\eca_content\Plugin\Action\TriggerContentEntityCustomEvent::execute is called without an entity being available, this throws an exception:
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->__construct()
#1 /var/www/html/web/modules/contrib/eca/src/Entity/Objects/EcaAction.php(98): Drupal\eca_content\Plugin\Action\TriggerContentEntityCustomEvent->execute()
#2 /var/www/html/web/modules/contrib/eca/src/Processor.php(178): Drupal\eca\Entity\Objects\EcaAction->execute()
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.
Edited by drupalbot