Browse Source

In media migrate, error "Call to function getMimeType() on null" (1825)

pull/837/head
Alexander O'Neill 5 years ago
parent
commit
592a513dbe
  1. 2
      src/Plugin/Condition/MediaSourceHasMimetype.php

2
src/Plugin/Condition/MediaSourceHasMimetype.php

@ -55,7 +55,7 @@ class MediaSourceHasMimetype extends ConditionPluginBase {
$source = $entity->getSource();
if ($source) {
$source_file = File::load($source->getSourceFieldValue($entity));
if ($this->configuration['mimetype'] == $source_file->getMimeType()) {
if (!empty($source_file) && $this->configuration['mimetype'] == $source_file->getMimeType()) {
return TRUE;
}
}

Loading…
Cancel
Save