[BUGFIX] Only load folder contents if folder is initialised
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / Collection / FolderBasedFileCollection.php
index fb42c5e..4718d24 100644 (file)
@@ -69,9 +69,11 @@ class FolderBasedFileCollection extends \TYPO3\CMS\Core\Resource\Collection\Abst
         * @return void
         */
        public function loadContents() {
-               $entries = $this->folder->getFiles();
-               foreach ($entries as $entry) {
-                       $this->add($entry);
+               if ($this->folder instanceof \TYPO3\CMS\Core\Resource\Folder) {
+                       $entries = $this->folder->getFiles();
+                       foreach ($entries as $entry) {
+                               $this->add($entry);
+                       }
                }
        }