Skip to content

Commit

Permalink
Fix bug with non-exist page
Browse files Browse the repository at this point in the history
Fix the bug that occures when indexer returns non-exist page.
  • Loading branch information
alexdraconian committed Jan 3, 2022
1 parent d209e09 commit 5775dcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helper.php
Expand Up @@ -31,11 +31,13 @@ function _get_page_data() {
$all_pages = idx_get_indexer()->getPages();
$pages = array();
foreach($all_pages as $pageid) {
$pages[$pageid] = array("exists"=>1, "links"=>0);
$pages[$pageid] = array("exists"=>page_exists($pageid), "links"=>0);
}

foreach($all_pages as $pageid) {

if (!page_exists($pageid)) continue;

$relation_data = p_get_metadata($pageid)['relation']['references'];
if (!is_null($relation_data)) {
foreach($relation_data as $name => $exist) {
Expand Down

0 comments on commit 5775dcd

Please sign in to comment.