Skip to content

Commit

Permalink
Merge pull request #895 from seth-shaw-asu/issue-2152
Browse files Browse the repository at this point in the history
Issue-2152: Throw error instead of returning null data
  • Loading branch information
ajstanley authored Aug 11, 2022
2 parents 7bca3d5 + d405a2f commit 62fbc6d
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 62fbc6d

Please sign in to comment.