Fix failure when "Test"ing a Java installation (#3935)

* Fix failure when "Test"ing a Java installation

* Fix lint
This commit is contained in:
Josiah Glosson
2025-07-07 14:11:36 -05:00
committed by GitHub
parent c47bcf665d
commit 088cb54317
3 changed files with 12 additions and 5 deletions

View File

@@ -166,10 +166,18 @@ pub async fn test_jre(
path: PathBuf,
major_version: u32,
) -> crate::Result<bool> {
let Ok(jre) = jre::check_java_at_filepath(&path).await else {
return Ok(false);
let jre = match jre::check_java_at_filepath(&path).await {
Ok(jre) => jre,
Err(e) => {
tracing::warn!("Invalid Java at {}: {e}", path.display());
return Ok(false);
}
};
let version = extract_java_version(&jre.version)?;
tracing::info!(
"Expected Java version {major_version}, and found {version} at {}",
path.display()
);
Ok(version == major_version)
}