rename: Fix crash when renaming a page that is linked to by a page in an underlay.
[ikiwiki.git] / IkiWiki / Plugin / rename.pm
index 57747d3c9df00141a1ade61e823c453a2ecbcc33..e871b815d6441a0cc52131932c283421c78c98c6 100644 (file)
@@ -567,6 +567,7 @@ sub fixlinks ($$$) {
                }
                if ($needfix) {
                        my $file=$pagesources{$page};
+                       next unless -e $config{srcdir}."/".$file;
                        my $oldcontent=readfile($config{srcdir}."/".$file);
                        my $content=renamepage_hook($page, $rename->{src}, $rename->{dest}, $oldcontent);
                        if ($oldcontent ne $content) {