diff options
author | Vika Shleina <vika@fireburn.ru> | 2021-07-19 12:12:56 +0300 |
---|---|---|
committer | Vika Shleina <vika@fireburn.ru> | 2021-07-19 12:12:56 +0300 |
commit | bc7f785bd88344d6be9cb32327ef108e03695345 (patch) | |
tree | 3d03a3304f831601b0b45cc8ff060ccd25a22d8f /src/frontend | |
parent | 1d431768d5290824b7f623042774e3e236c532a1 (diff) | |
download | kittybox-bc7f785bd88344d6be9cb32327ef108e03695345.tar.zst |
Fixed crash when h-card doesn't contain a p-note
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
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<S: Storage>(mut req: Request<ApplicationState<S>>) -> 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(); |