Skip to content

Commit 54fe742

Browse files
committed
Logging None returns causing Errors in bio_enrollment
1 parent c0e4a86 commit 54fe742

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

libwebauthn/src/management/bio_enrollment.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ where
8181
let req = Ctap2BioEnrollmentRequest::new_get_modality();
8282
// No UV needed
8383
let resp = self.ctap2_bio_enrollment(&req, timeout).await?;
84-
resp.modality.ok_or(Error::Ctap(CtapError::Other))
84+
match resp.modality {
85+
Some(modality) => Ok(modality),
86+
None => {
87+
info!("Channel did not return modality.");
88+
Err(Error::Ctap(CtapError::Other))
89+
}
90+
}
8591
}
8692

8793
async fn get_fingerprint_sensor_info(
@@ -91,8 +97,12 @@ where
9197
let req = Ctap2BioEnrollmentRequest::new_fingerprint_sensor_info();
9298
// No UV needed
9399
let resp = self.ctap2_bio_enrollment(&req, timeout).await?;
100+
let Some(fingerprint_kind) = resp.fingerprint_kind else {
101+
info!("Channel did not return fingerprint_kind Sensor Info");
102+
return Err(Error::Ctap(CtapError::Other))
103+
};
94104
Ok(Ctap2BioEnrollmentFingerprintSensorInfo {
95-
fingerprint_kind: resp.fingerprint_kind.ok_or(Error::Ctap(CtapError::Other))?,
105+
fingerprint_kind,
96106
max_capture_samples_required_for_enroll: resp
97107
.max_capture_samples_required_for_enroll
98108
.clone(),

0 commit comments

Comments
 (0)