Skip to content

Commit a605713

Browse files
committed
bail! in render() if specified theme directory does not exist
1 parent e1c2e1a commit a605713

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/renderer/html_handlebars/hbs_renderer.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,13 @@ impl Renderer for HtmlHandlebars {
481481
let mut handlebars = Handlebars::new();
482482

483483
let theme_dir = match html_config.theme {
484-
Some(ref theme) => ctx.root.join(theme),
484+
Some(ref theme) => {
485+
let dir = ctx.root.join(theme);
486+
if !dir.is_dir() {
487+
bail!("theme dir {} does not exist", dir.display());
488+
}
489+
dir
490+
}
485491
None => ctx.root.join("theme"),
486492
};
487493

0 commit comments

Comments
 (0)