diff --git a/src/Plugin/QueueWorker/FixityCheckWorker.php b/src/Plugin/QueueWorker/FixityCheckWorker.php index 65704e5..452cf85 100644 --- a/src/Plugin/QueueWorker/FixityCheckWorker.php +++ b/src/Plugin/QueueWorker/FixityCheckWorker.php @@ -6,6 +6,7 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Queue\QueueWorkerBase; use Drupal\dgi_fixity\FixityCheckInterface; use Drupal\dgi_fixity\FixityCheckServiceInterface; +use Drupal\file\FileInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -61,7 +62,12 @@ class FixityCheckWorker extends QueueWorkerBase implements ContainerFactoryPlugi public function processItem($data) { if ($data instanceof FixityCheckInterface) { /** @var \Drupal\dgi_fixity\FixityCheckInterface $data */ - $this->fixity->check($data->getFile()); + if ($data->getFile() instanceof FileInterface) { + $this->fixity->check($data->getFile()); + } + else { + $data->setState(FixityCheckInterface::STATE_MISSING); + } } }