mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-01-31 10:07:36 +00:00
Fix crash when a bad user ID is in the database
To my understanding, a bad user ID can sometimes make it into the database, which lead to a panic prior to this change.
This commit is contained in:
parent
08072d2c8d
commit
4a12a7cbc8
@ -405,10 +405,11 @@ async fn sync_helper(
|
||||
continue;
|
||||
}
|
||||
};
|
||||
lazy_loaded.insert(
|
||||
UserId::parse(state_key.as_ref())
|
||||
.expect("they are in timeline_users, so they should be correct"),
|
||||
);
|
||||
|
||||
// This check is in case a bad user ID made it into the database
|
||||
if let Ok(uid) = UserId::parse(state_key.as_ref()) {
|
||||
lazy_loaded.insert(uid);
|
||||
}
|
||||
state_events.push(pdu);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user