Skip to content

Commit

Permalink
throw error instead of returning null data
Browse files Browse the repository at this point in the history
Avoids WSOD when EmitEvent creates a StompHeaderEvent
  • Loading branch information
seth-shaw-asu authored Aug 9, 2022
1 parent 7bca3d5 commit d405a2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function defaultConfiguration() {
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) {
Expand Down

0 comments on commit d405a2f

Please sign in to comment.