diff --git a/core/core.php b/core/core.php index 52afc750..4c82c9bd 100755 --- a/core/core.php +++ b/core/core.php @@ -1264,12 +1264,13 @@ class common { } // Image de couverture if ( $this->getdata(['module',$parent,$galleryKey,'config','homePicture']) === NULL) { - $iterator = new DirectoryIterator($this->getdata(['module',$parent,$galleryKey,'config','directory'])); - foreach($iterator as $fileInfos) { - if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { - $this->setdata(['module',$parent,$galleryKey,'config','homePicture',$fileInfos->getFilename()]); - break; - + if (is_dir($this->getdata(['module',$parent,$galleryKey,'config','directory']))) { + $iterator = new DirectoryIterator($this->getdata(['module',$parent,$galleryKey,'config','directory'])); + foreach($iterator as $fileInfos) { + if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { + $this->setdata(['module',$parent,$galleryKey,'config','homePicture',$fileInfos->getFilename()]); + break; + } } } }