Merge pull request #1145 from Rosto75/master

Add a case for an empty `book_title` parameter
This commit is contained in:
Eric Huss 2020-02-15 16:11:08 -08:00 committed by GitHub
commit d6cfa21fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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));