Skip to content

Commit 4e1823b

Browse files
Fix Page with No Associated Folder
1 parent b4b3544 commit 4e1823b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ function route__page($content, $path, $query, $hash) {
119119
if (\is_file($folder . \D . '.' . $page->x)) {
120120
\kick('/' . $path);
121121
}
122-
$pages = $page->children('page', $deep)->sort($sort);
122+
if ($pages = $page->children('page', $deep)) {
123+
$pages = $pages->sort($sort);
124+
} else {
125+
$pages = new \Pages;
126+
}
123127
// A page “part” query was passed to the URL path, but this page has no sub-page(s). Treat it as a
124128
// single page with error state because requesting sub-page(s) on a single page is not allowed.
125129
if (0 === ($count = $pages->count)) { // Total number of page(s) before chunk

0 commit comments

Comments
 (0)