Browse Source

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

pull/838/head
Alexander O'Neill 4 years ago committed by GitHub
parent
commit
cf82e8f392
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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