[BUGFIX] Only load folder contents if folder is initialised 29/22829/4
authorFrans Saris <franssaris@gmail.com>
Mon, 5 Aug 2013 20:13:55 +0000 (22:13 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 15 Oct 2013 07:36:59 +0000 (09:36 +0200)
FolderBasedFileCollection::loadContents() has to check if
the folder is initialised prior to loading the contents to
prevent fatal errors.

Fixes: #50802
Releases: 6.2, 6.1, 6.0
Change-Id: If3ce06cff13595da49abbb6aa99c891969aea692
Reviewed-on: https://review.typo3.org/22829
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Markus Klein
Tested-by: Markus Klein
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() {
         * @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);
+                       }
                }
        }
 
                }
        }