diff --git a/typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/FolderRestriction.php b/typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/FolderRestriction.php
index 1427235362aaa7f761f01c3660ab8e4b4081232c..8817478d39d50cbcb3cfbe8b5319b8bb33f23ff4 100644
--- a/typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/FolderRestriction.php
+++ b/typo3/sysext/core/Classes/Resource/Search/QueryRestrictions/FolderRestriction.php
@@ -51,7 +51,7 @@ class FolderRestriction extends AbstractRestrictionContainer
             $this->add($this->createFolderRestriction());
             return;
         }
-        if ($this->folder->getIdentifier() === $storage->getRootLevelFolder()->getIdentifier()) {
+        if ($this->folder->getIdentifier() === $storage->getRootLevelFolder(false)->getIdentifier()) {
             return;
         }
         if ($storage->hasHierarchicalIdentifiers()) {