Browse Source

fix WSOD when media source file is missing (#834)

pull/837/head
Seth Shaw 4 years ago committed by GitHub
parent
commit
e57c82b888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Plugin/Condition/MediaHasMimetype.php

2
src/Plugin/Condition/MediaHasMimetype.php

@ -151,7 +151,7 @@ class MediaHasMimetype extends ConditionPluginBase implements ContainerFactoryPl
$mimetypes = explode(',', str_replace(' ', '', $this->configuration['mimetypes'])); $mimetypes = explode(',', str_replace(' ', '', $this->configuration['mimetypes']));
foreach ($media as $medium) { foreach ($media as $medium) {
$file = $this->mediaSource->getSourceFile($medium); $file = $this->mediaSource->getSourceFile($medium);
if (in_array($file->getMimeType(), $mimetypes)) { if ($file && in_array($file->getMimeType(), $mimetypes)) {
return TRUE; return TRUE;
} }
} }

Loading…
Cancel
Save