diff --git a/src/sbot.rs b/src/sbot.rs index c5b7134..ac0cdf3 100644 --- a/src/sbot.rs +++ b/src/sbot.rs @@ -185,7 +185,10 @@ pub async fn get_root_posts( if !content_map.contains_key("root") { latest_sequence = msg.value.sequence; - let text = content_map.get_key_value("text").unwrap().1.to_string(); + let text = match content_map.get_key_value("text") { + Some(value) => value.1.to_string(), + None => String::from(""), + }; let timestamp = msg.value.timestamp.round() as i64 / 1000; let datetime = NaiveDateTime::from_timestamp(timestamp, 0); let date = datetime.format("%d %b %Y").to_string();