From bc7f785bd88344d6be9cb32327ef108e03695345 Mon Sep 17 00:00:00 2001 From: Vika Shleina Date: Mon, 19 Jul 2021 12:12:56 +0300 Subject: Fixed crash when h-card doesn't contain a p-note --- src/frontend/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index 165d89d..cfef379 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -469,8 +469,10 @@ mod templates { ")" } } - p."p-note" { - @card["properties"]["note"][0]["value"].as_str().unwrap_or_else(|| card["properties"]["note"][0].as_str().unwrap()) + @if card["properties"]["note"].is_array() { + p."p-note" { + @card["properties"]["note"][0]["value"].as_str().unwrap_or_else(|| card["properties"]["note"][0].as_str().unwrap()) + } } @if card["properties"]["url"].is_array() { ul { @@ -794,7 +796,6 @@ pub async fn mainpage(mut req: Request>) -> Resu #[cfg(all(debug_assertions, not(test)))] let url = url::Url::parse("https://localhost:8080/").unwrap(); - info!("Request at {}", url); let hcard_url = url.as_str(); let feed_url = url.join("feeds/main").unwrap().to_string(); -- cgit 1.4.1