]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
Fix ugly display when editing a page that has vanished.
[ikiwiki.git] / IkiWiki.pm
index 3802559a53d6c60569464a17b95109f9eab807a5..f5cf8ba96bbc8d61a6e801d9058e13955e5108c6 100644 (file)
@@ -282,14 +282,15 @@ sub htmlpage ($) { #{{{
        return targetpage($page, $config{htmlext});
 } #}}}
 
-sub srcfile ($) { #{{{
+sub srcfile ($;$) { #{{{
        my $file=shift;
+       my $nothrow=shift;
 
        return "$config{srcdir}/$file" if -e "$config{srcdir}/$file";
        foreach my $dir (@{$config{underlaydirs}}, $config{underlaydir}) {
                return "$dir/$file" if -e "$dir/$file";
        }
-       error("internal error: $file cannot be found in $config{srcdir} or underlay");
+       error("internal error: $file cannot be found in $config{srcdir} or underlay") unless $nothrow;
        return;
 } #}}}