mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-14 07:51:01 +00:00
Avoid panics when encountering an invalid mention
This commit is contained in:
parent
67dd577a27
commit
cf23360c4a
1 changed files with 2 additions and 2 deletions
|
@ -63,8 +63,8 @@ impl Mention {
|
|||
}
|
||||
|
||||
pub fn from_activity(conn: &PgConnection, ment: link::Mention, inside: i32, in_post: bool) -> Option<Self> {
|
||||
let ap_url = ment.link_props.href_string().unwrap();
|
||||
let mentioned = User::find_by_ap_url(conn, ap_url).unwrap();
|
||||
let ap_url = ment.link_props.href_string().ok()?;
|
||||
let mentioned = User::find_by_ap_url(conn, ap_url)?;
|
||||
|
||||
if in_post {
|
||||
Post::get(conn, inside.clone().into()).map(|post| {
|
||||
|
|
Loading…
Reference in a new issue