ignore logs with invalid steam ids

This commit is contained in:
Robin Appelman 2020-06-18 15:21:53 +02:00
commit 17db2f8074

View file

@ -58,7 +58,15 @@ async fn get_log(pool: &PgPool, id: i32) -> Result<Option<NormalizedLog>, MainEr
.await?;
if is_valid(&row.0) {
Ok(serde_json::from_value(row.0)?)
match serde_json::from_value(row.0) {
Ok(log) => Ok(Some(log)),
Err(err) => {
if format!("{}", err).starts_with("Invalid SteamID") {
return Ok(None);
}
Err(err.into())
}
}
} else {
Ok(None)
}