From d405a2f14fd5cf1ce8cd95497643b2201458fb65 Mon Sep 17 00:00:00 2001 From: Seth Shaw <108362375+seth-shaw-asu@users.noreply.github.com> Date: Tue, 9 Aug 2022 13:09:23 -0700 Subject: [PATCH] throw error instead of returning null data Avoids WSOD when EmitEvent creates a StompHeaderEvent --- src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php b/src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php index f484fdc3..be9eca80 100644 --- a/src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php +++ b/src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php @@ -40,7 +40,7 @@ class AbstractGenerateDerivativeMediaFile extends AbstractGenerateDerivativeBase protected function generateData(EntityInterface $entity) { $data = parent::generateData($entity); if (get_class($entity) != 'Drupal\media\Entity\Media') { - return; + throw new \RuntimeException("Entity {$entity->getEntityTypeId()} {$entity->id()} is not a media", 500); } $source_file = $this->mediaSource->getSourceFile($entity); if (!$source_file) {