Make sure that variable is defined in PageIndex::getLevelListing()

This commit is contained in:
Matias Griese
2021-03-04 17:10:02 +02:00
parent 1ba35f0bc3
commit 1297114b3e

View File

@@ -310,6 +310,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
/** @var Debugger $debugger */
$debugger = Grav::instance()['debugger'];
$result = null;
try {
$cached = $cache->get($key);
$test = $cached[0] ?? null;
@@ -319,7 +320,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface
}
try {
if (!isset($result)) {
if (null === $result) {
$result = $this->getLevelListingRecurse($options);
$cache->set($key, [$checksum, $result]);
}