diff --git a/src/client_server/sync.rs b/src/client_server/sync.rs index eec4cf6d55b7a183711f5ee0e7f2bb5519f83941..5f34fa6b092b77eab6af6bc6f3764519b1a259f3 100644 --- a/src/client_server/sync.rs +++ b/src/client_server/sync.rs @@ -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); } }