Skip to content

Commit ab8dbb1

Browse files
fix: no panic if key_algorithm is not set in JWK (#425)
1 parent 87bbe49 commit ab8dbb1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/jwk.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,10 @@ pub struct Jwk {
414414
impl Jwk {
415415
/// Find whether the Algorithm is implemented and supported
416416
pub fn is_supported(&self) -> bool {
417-
self.common.key_algorithm.unwrap().to_algorithm().is_ok()
417+
match self.common.key_algorithm {
418+
Some(alg) => alg.to_algorithm().is_ok(),
419+
_ => false,
420+
}
418421
}
419422
}
420423

0 commit comments

Comments
 (0)