]> _ Git - odl.git/commitdiff
done #4806 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 21 Oct 2021 12:58:09 +0000 (14:58 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 21 Oct 2021 12:58:09 +0000 (14:58 +0200)
app/Jobs/ProcessFluidbook.php

index 402b06622bea26aace2de3efae3d64913e444b74..3bbf0984c71dbdab35c2f8baa37fa945f857dc43 100644 (file)
@@ -71,7 +71,7 @@ class ProcessFluidbook extends Compiler
             throw new \Exception('L\'élement ' . $id . ' n\'existe pas dans la médiathèque');
         }
         $collection = $asset->getMediaInField($asset->getAttributeValue('file_upload'));
-        if ($collection->count() === 0) {
+        if ((is_array($collection) && count($collection) === 0) || $collection->count() === 0) {
             throw new \Exception('L\'élement ' . $id . ' de la médiathèque ne contient aucun fichier');
         }
         return $collection;