Skip to content

Commit

Permalink
Merge pull request #1145 from Rosto75/master
Browse files Browse the repository at this point in the history
Add a case for an empty `book_title` parameter
  • Loading branch information
ehuss authored Feb 16, 2020
2 parents d599984 + 95fba3f commit d6cfa21
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/renderer/html_handlebars/hbs_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ impl HtmlHandlebars {
.get("book_title")
.and_then(serde_json::Value::as_str)
.unwrap_or("");
title = ch.name.clone() + " - " + book_title;

title = match book_title {
"" => ch.name.clone(),
_ => ch.name.clone() + " - " + book_title,
}
}

ctx.data.insert("path".to_owned(), json!(path));
Expand Down

0 comments on commit d6cfa21

Please sign in to comment.