Only build an index for the old version if it actually exists

This commit is contained in:
Starbeamrainbowlabs 2015-12-05 17:37:45 +00:00
parent d55132fd19
commit 8924c7b9ac
1 changed files with 3 additions and 1 deletions

View File

@ -139,7 +139,9 @@ register_module([
// Update the inverted search index
// Construct an index for the old and new page content
$oldindex = search::index(file_get_contents("$env->page.md"));
$oldindex = [];
if(file_exists("$env->page.md"))
$oldindex = search::index(file_get_contents("$env->page.md"));
$newindex = search::index($pagedata);
// Compare the indexes of the old and new content