Browse Source

throw error instead of returning null data

Avoids WSOD when EmitEvent creates a StompHeaderEvent
pull/882/head
Seth Shaw 3 years ago committed by Rosie Le Faive
parent
commit
0a4bfb48d5
  1. 2
      src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php

2
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) {

Loading…
Cancel
Save