Skip to content

Commit

Permalink
Merge pull request #9 from joelwurtz/fix/panic-version-compare
Browse files Browse the repository at this point in the history
fix(browsers): fix panic when version compare fail
  • Loading branch information
vanetix authored Dec 26, 2024
2 parents 8fa69a0 + 0e7e209 commit 349f82a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/parsers/client/browsers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,15 +401,14 @@ impl BrowserClientList {
.unwrap_or(Ordering::Equal)
});

engine_versions
.into_iter()
.for_each(|(engine_version, eng)| {
if let Cmp::Eq | Cmp::Gt =
version_compare::compare(version, engine_version).expect("valid version")
{
engine = Some(eng.clone())
for (engine_version, eng) in &engine_versions {
match version_compare::compare(version, engine_version) {
Ok(Cmp::Eq) | Ok(Cmp::Gt) => {
engine = Some(eng.to_string());
}
});
_ => {}
}
}

engine = engine.or_else(|| entry_engine.default.clone());

Expand Down

0 comments on commit 349f82a

Please sign in to comment.